-
Notifications
You must be signed in to change notification settings - Fork 1
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
Surface Diffusion Estimator Example and Associated Improvements #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also format the notebook? Mostly to add blank after commas. You can pip install "black[jupyter]"
and run that through the notebook.
except (TypeError, OverflowError): | ||
rule = to_dict(node.rule) #will work on all rmgmolecule objects, new objects need this method implemented | ||
try: | ||
json.dumps(rule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? Do you not need to open a file handler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generates the serialization without putting it in a file.
pysidt/sidt.py
Outdated
try: | ||
json.dumps(rule) | ||
except: | ||
print(rule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write proper logger and informative error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've provided a more informative error message and removed the logging.
3d04877
to
6e546df
Compare
I formatted the notebook manually. Should be ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More questions regarding the code
- cairo | ||
- cairocffi | ||
- pyrdl | ||
- python >=3.7,<3.10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is blocking 3.10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have rmgmolecule for >3.9
pysidt/sidt.py
Outdated
out_dict[attr] = val | ||
except: | ||
if isinstance(val, ScalarQuantity): | ||
d = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? d
is not used anywhere? Can we add test for this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, we do test this in the notebook, although it's more of a functional test through write_nodes. I can construct a nosetests framework. I'm not very familiar with pytest though, so if we want to continue using pytest it's probably most efficient if you setup the framework.
e45d2ea
to
84d4bdc
Compare
from_dict docstring
write nodes amend
84d4bdc
to
1b71b52
Compare
I'm a bit unsure about some of the choices the formatter made in the notebook, I think it was better before. |
1b71b52
to
40dad62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This primarily adds an example notebook for estimating surface diffusion coefficients with single evaluation SIDT. This primarily required improvements to how we save and load tree nodes to handle non-JSON serializable objects.