New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

elements

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elements - pypi Package Compare versions

Comparing version
3.18.0
to
3.18.1
+1
-1
elements.egg-info/PKG-INFO
Metadata-Version: 2.1
Name: elements
Version: 3.18.0
Version: 3.18.1
Summary: Building blocks for productive research.

@@ -5,0 +5,0 @@ Home-page: http://github.com/danijar/elements

@@ -1,2 +0,2 @@

__version__ = '3.18.0'
__version__ = '3.18.1'

@@ -20,2 +20,3 @@ from .agg import Agg

from . import checkpoint
from . import logger

@@ -22,0 +23,0 @@ from . import plotting

@@ -95,6 +95,6 @@ import inspect

if keys is None:
saveables = self._saveables
savefns = {k: v.save for k, v in self._saveables.items()}
else:
assert all([not k.startswith('_') for k in keys]), keys
saveables = {k: self._saveables[k] for k in keys}
savefns = {k: self._saveables[k].save for k in keys}
if path:

@@ -108,3 +108,3 @@ folder = None

printing.print_(f'Saving checkpoint: {path}')
save(path, saveables, self._write)
save(path, savefns, self._write)
if folder and self._write:

@@ -119,6 +119,6 @@ (self._directory / 'latest').write_text(folder)

if keys is None:
saveables = self._saveables
loadfns = {k: v.load for k, v in self._saveables.items()}
else:
assert all([not k.startswith('_') for k in keys]), keys
saveables = {k: self._saveables[k] for k in keys}
loadfns = {k: self._saveables[k].load for k in keys}
if not path:

@@ -128,3 +128,3 @@ path = self.latest()

printing.print_(f'Loading checkpoint: {path}')
load(path, saveables)
load(path, loadfns)
print('Loaded checkpoint.')

@@ -159,9 +159,9 @@

def save(path, saveables, write=True):
def save(path, savefns, write=True):
path = pathlib.Path(path)
assert not exists(path), path
write and path.mkdir(parents=True)
for name, saveable in saveables.items():
for name, savefn in savefns.items():
try:
data = saveable.save()
data = savefn()
if inspect.isgenerator(data):

@@ -183,7 +183,7 @@ for i, shard in enumerate(data):

def load(path, saveables):
def load(path, loadfns):
path = pathlib.Path(path)
assert exists(path), path
filenames = set(path.glob('*'))
for name, saveable in saveables.items():
for name, loadfn in loadfns.items():
try:

@@ -193,3 +193,3 @@ if (path / f'{name}.pkl') in filenames:

data = pickle.loads(buffer)
saveable.load(data)
loadfn(data)
elif (path / f'{name}-0000.pkl') in filenames:

@@ -203,3 +203,3 @@ shards = [x for x in filenames if x.name.startswith(f'{name}-')]

yield data
saveable.load(generator())
loadfn(generator())
else:

@@ -206,0 +206,0 @@ raise KeyError(name)

Metadata-Version: 2.1
Name: elements
Version: 3.18.0
Version: 3.18.1
Summary: Building blocks for productive research.

@@ -5,0 +5,0 @@ Home-page: http://github.com/danijar/elements