Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber authored Nov 10, 2023
1 parent 63ab5ec commit 79df6ad
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/plumpy/base/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def wrapper(self: Any, *args: Any, **kwargs: Any) -> None:
wrapped(self, *args, **kwargs)
self._called -= 1

#the following is to show the correct name later in the call_with_super_check error message
# Forward wrapped function name to the decorator to show the correct name in the ``call_with_super_check``
wrapper.__name__ = wrapped.__name__
return wrapper

Expand Down
2 changes: 1 addition & 1 deletion src/plumpy/event_helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import logging
from typing import TYPE_CHECKING, Any, Callable, Set, Type
from typing import TYPE_CHECKING, Any, Callable

from . import persistence

Expand Down
4 changes: 1 addition & 3 deletions test/test_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,8 @@ def test_instance_state_with_outputs(self):
# Check that it is a copy
self.assertIsNot(outputs, bundle.get(BundleKeys.OUTPUTS, {}))
# Check the contents are the same
#we remove the ProcessSaver instance that is an object used only for testing
# Remove the ``ProcessSaver`` instance that is only used for testing
utils.compare_dictionaries(None, None, outputs, bundle.get(BundleKeys.OUTPUTS, {}), exclude={'_listeners'})
#self.assertDictEqual(outputs, bundle.get(BundleKeys.OUTPUTS, {}))

self.assertIsNot(proc.outputs, saver.snapshots[-1].get(BundleKeys.OUTPUTS, {}))

Expand Down Expand Up @@ -877,7 +876,6 @@ def _check_round_trip(self, proc1):
bundle2 = plumpy.Bundle(proc2)

self.assertEqual(proc1.pid, proc2.pid)
#self.assertDictEqual(bundle1, bundle2)
utils.compare_dictionaries(None, None, bundle1, bundle2, exclude={'_listeners'})


Expand Down
3 changes: 0 additions & 3 deletions test/test_workchains.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,9 @@ def define(cls, spec):
)

def step1(self):
print('step1')
persister.save_checkpoint(self, 'step1')

def step2(self):
print('step2')
persister.save_checkpoint(self, 'step2')

# add SimpleWorkChain and TestListener to this module global namespace, so they can be reloaded from checkpoint
Expand All @@ -321,7 +319,6 @@ def step2(self):

self.assertEqual(process_finished_count, 1)

print('reload persister checkpoint:')
workchain_checkpoint = persister.load_checkpoint(workchain.pid, 'step1').unbundle()
workchain_checkpoint.execute()
self.assertEqual(process_finished_count, 2)
Expand Down

0 comments on commit 79df6ad

Please sign in to comment.