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

Expose dict values as list #93

Merged
merged 3 commits into from
Nov 28, 2023
Merged

Expose dict values as list #93

merged 3 commits into from
Nov 28, 2023

Conversation

liamhuber
Copy link
Member

Just adds to_list() methods to DotDict and DataIO so the dictionaries can be case to value lists. The order is explicitly not guaranteed, but it winds up being the order items are added to the underlying dict.

As requested in #38.

Closes #40.

Copy link

Binder 👈 Launch a binder notebook on branch pyiron/pyiron_workflow/expose_dict_values_as_list

@liamhuber
Copy link
Member Author

======================================================================
ERROR: test_connection (unit.test_io.TestDataIO.test_connection)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/pyiron_workflow/pyiron_workflow/tests/unit/test_io.py", line 68, in test_connection
    self.input.x = self.input.y
    ^^^^^^^^^^^^
  File "/home/runner/work/pyiron_workflow/pyiron_workflow/pyiron_workflow/io.py", line 76, in __setattr__
    self._assign_value_to_existing_channel(self.channel_dict[key], value)
  File "/home/runner/work/pyiron_workflow/pyiron_workflow/pyiron_workflow/io.py", line 92, in _assign_value_to_existing_channel
    channel.connect(value.channel)
  File "/home/runner/work/pyiron_workflow/pyiron_workflow/pyiron_workflow/channels.py", line 126, in connect
    raise ChannelConnectionError(
pyiron_workflow.channels.ChannelConnectionError: x (InputData) and y (InputData) share a generic type but were not a valid connection. Check channel classes, type hints, etc.

Riiight. Because the two tests each had the same name, only one of them was getting run and it wasn't this one. This actually does break expectations -- trying to assign input to input should raise an error.

They weren't running because of the typo where they had the same name as the other test suite, and they got out of date.
Copy link

Pull Request Test Coverage Report for Build 7014888358

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • 14 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 86.064%

Files with Coverage Reduction New Missed Lines %
pyiron_workflow/util.py 3 86.67%
pyiron_workflow/io.py 5 88.31%
io.py 6 91.73%
Totals Coverage Status
Change from base Build 7008406840: -0.1%
Covered Lines: 3304
Relevant Lines: 3839

💛 - Coveralls

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.19% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (56a7dfc) 1986 1563 78.70%
Head commit (c0f929f) 1990 (+4) 1570 (+7) 78.90% (+0.19%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#93) 4 4 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@liamhuber liamhuber merged commit 4487bb3 into main Nov 28, 2023
17 checks passed
@liamhuber liamhuber deleted the expose_dict_values_as_list branch November 28, 2023 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Results to list easier
1 participant