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

Qol workflow reprs #658

Merged
merged 6 commits into from
May 2, 2023
Merged

Qol workflow reprs #658

merged 6 commits into from
May 2, 2023

Conversation

liamhuber
Copy link
Member

  • Channel values are now stringified before being placed in the to_dict dictionary, which avoids errors when trying to view, e.g., channels that hold an Atoms object. A different solution will be needed for actual serialization, but this works fine for display purposes.
  • Workflow and IO somehow aren't getting their pretty JSON representation triggered, even though Node and Channel do and they all just inherit this functionality from HasToDict. Until I can figure out why and fix it, I added a method json_repr() to force this behaviour.

liamhuber added 5 commits May 2, 2023 12:33
For some reason the _repr_json_ method is getting automatically triggered for `Node` and `Channel`, but _not_ for `Workflow` and `IO`. Until I can figure out why and fix it, let's just give users easy access to a manual workaround
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4865619290

  • 3 of 6 (50.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 13.358%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_contrib/workflow/has_to_dict.py 2 3 66.67%
pyiron_contrib/workflow/channels.py 1 3 33.33%
Files with Coverage Reduction New Missed Lines %
pyiron_contrib/workflow/has_to_dict.py 1 69.23%
Totals Coverage Status
Change from base Build 4864988965: 0.01%
Covered Lines: 1646
Relevant Lines: 12322

💛 - Coveralls

def info(self):
print(dumps(self.to_dict(), indent=2))

def repr_json(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shoud be a repr_json or similar method used in notebooks to Display the object automatically as json

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.

3 participants