Skip to content

Commit

Permalink
reshuffle pickling
Browse files Browse the repository at this point in the history
  • Loading branch information
VanyaBelyaev committed Apr 24, 2024
1 parent ba650ed commit eb24388
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ostap/io/pickling.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def pickles ( obj ) :
try:
pkl = loads ( dumps ( obj ) )
return pkl == obj
except ( PicklingError, UnpicklingError ) :
except ( PicklingError, UnpicklingError , AttributeError ) :
return False

# =============================================================================
Expand All @@ -75,7 +75,7 @@ def check ( obj ):
fail = True
try:
_obj = dumps(obj,)
except PicklingError :
except ( PicklingError , AttributeError ) :
return None
##
msg = "%s -c import pickle; print(pickle.loads(%s))" % ( python , repr ( _obj ) )
Expand Down
6 changes: 5 additions & 1 deletion ostap/parallel/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@
worker = 'GAUDI'

# =============================================================================
## check if object can be pickled
## check if object can be pickled & nupickled
def pickles ( obj ) :
""" Check if object can be pickled & unpiickled
"""
print ( 'PICKLES:' , dill, WorkManager, worker )
if dill and WorkManager and worker == 'PATHOS' :
return dill.pickles ( obj )
from ostap.io.pickling import pickles as _pickles
Expand All @@ -140,6 +143,7 @@ def pickles ( obj ) :
def check ( obj ):
"""Check pickling of an object across another process
"""
print ( 'CHECK:' , dill, WorkManager, worker )
if dill and WorkManager and worker == 'PATHOS' :
return dill.check ( obj )
from ostap.io.pickling import check as _check
Expand Down

0 comments on commit eb24388

Please sign in to comment.