Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate dictionary directly #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ema_workbench/em_framework/outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def __eq__(self, other):
all(
hasattr(self, key) == hasattr(other, key)
and getattr(self, key) == getattr(other, key)
for key in self.__dict__.keys()
for key in self.__dict__
),
self.__class__ == other.__class__,
]
Expand Down
2 changes: 1 addition & 1 deletion ema_workbench/examples/eijgenraam_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
52: (49.2200, 1.6075, 0.0047, 0.036173, 0.304, 0.001716, 4025.6, 0.00171, 1 / 1250),
53: (69.4565, 1.1625, 0.0028, 0.031651, 0.336, 0.002700, 9819.5, 0.00171, 1 / 1250),
}
data = {i: {k: v for k, v in zip(params, raw_data[i])} for i in raw_data.keys()}
data = {i: {k: v for k, v in zip(params, raw_data[i])} for i in raw_data}

# Set the ring we are analyzing
ring = 15
Expand Down
2 changes: 1 addition & 1 deletion test/test_em_framework/test_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_store_results(self):

_, out = callback.get_results()

self.assertIn(outcomes[0].name, {entry for entry in out.keys()})
self.assertIn(outcomes[0].name, {entry for entry in out})
self.assertEqual(out[outcomes[0].name].shape, (3,))

# case 2 time series shape = (1, nr_time_steps)
Expand Down
2 changes: 1 addition & 1 deletion test/test_em_framework/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_namedict(self):
self.assertEqual(2, len(nd), "length not correct")

# test in
for entry in kwargs.keys():
for entry in kwargs:
self.assertIn(entry, nd, f"{entry} not in NamedDict")

# test addition
Expand Down