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

write_json parameter not respected and does not work #20

Open
infispiel opened this issue Feb 6, 2025 · 0 comments
Open

write_json parameter not respected and does not work #20

infispiel opened this issue Feb 6, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@infispiel
Copy link
Member

Attempted to enable write_json to test output. Turns out the MFD class is never passed the write_json parameter and therefore cannot respect it. Further, attempting to write json has the following error:

Exception has occurred: TypeError
Object of type Block is not JSON serializable
  File "/home/systematical/code/medford/src/MEDFORD/medford.py", line 142, in run_medford
    json.dump(self.dict_data, f, indent=2)
  File "/home/systematical/code/medford/src/MEDFORD/medford.py", line 212, in parse_args_and_go
    mfd.run_medford()
  File "/home/systematical/code/medford/src/MEDFORD/medford.py", line 220, in <module>
    parse_args_and_go()
TypeError: Object of type Block is not JSON serializable

This is because it is attempting to dump the entire self.dict_data object, which contains the Block objects still:

Image

@infispiel infispiel self-assigned this Feb 6, 2025
@infispiel infispiel changed the title write_json not respected and does not work write_json parameter not respected and does not work Feb 6, 2025
@infispiel infispiel added the bug Something isn't working label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant