Skip to content

Commit

Permalink
logger for load process from context
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jan 18, 2025
1 parent c3f0995 commit 75ff4a3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plumpy/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,20 @@ def recreate_from(
if 'loop' in load_context:
proc._loop = load_context.loop
else:
_LOGGER.warning(f'cannot find `loop` store in load_context, use default event loop')
proc._loop = asyncio.get_event_loop()

proc._state = proc.recreate_state(saved_state['_state'])

if 'communicator' in load_context:
if 'coordinator' in load_context:
proc._coordinator = load_context.coordinator
else:
_LOGGER.warning(f'cannot find `coordinator` store in load_context')

if 'logger' in load_context:
proc._logger = load_context.logger
else:
_LOGGER.warning(f'cannot find `logger` store in load_context')

# Need to call this here as things downstream may rely on us having the runtime variable above
persistence.load_auto_persist_params(proc, saved_state, load_context)
Expand Down

0 comments on commit 75ff4a3

Please sign in to comment.