-
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
added branch composition to the modelsystem normalizer #76
Conversation
Pull Request Test Coverage Report for Build 9268882832Details
💛 - Coveralls |
@JosePizarro3, @Bernadette-Mohr I am not attached to this notation, but I think it is useful for understanding what each branch is containing. Let me know what you think. There are TODOs and ?'s that warrant addressing, please have a look at those. |
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.
Very good, just some minor reorganization comments.
I am mainly interested on moving the couple of functions you have under normalize()
directly as class methods and combine them into something called resolve_composition_formula
. Still, you will need to define a specific function inside there to do the recursion.
I will also change the .get('...')
methods for our typical style to resolve quantities and sub-sections, e.g., system.model_system
instead of system.get('model_system')
. I think the second would return a dictionary, but I'd might be wrong.
Let me know if you need help or something is not clear.
@JosePizarro3 In terms of I will change it, just wanted to clarify. |
Yeah, this is actually kind of annoying. @TLCFEM @ladinesa could this be implemented or is there any reason why we don't want |
model_system since it is repeating subsection should return an empty list right? |
I actually wasn't saying it doesn't. I was asking if all metainfo sections and attributes are automatically populated with None (or empty lists) so that you don't ever need to do .get() because you won't get an error. Is that true? At what point are they populated, at instantiation? |
yes it should be the case, I have not encoutered a case where I need to use .get |
@JosePizarro3 This is ready for another review. No rush though, you can leave it till after the project meeting if you don't have time. I did make some improvements to the testing, I know it's not exactly what you had in mind, and I still feel that it is not ideal in the sense that the generation of the hierarchy is sort of complicated (I guess I could move this to some template generator?), but I am not exactly sure an alternative. That being said, I think the functionality is much better now in the sense that I actually test a bunch of cases where quantities might be missing, and I tried to document this in the description. |
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.
Very good, just some final minor details that will make your life easier when writing docstrings for functions.
I really liked the testing, it made it very easy to understand the implementation, and I am surprised that this actually decreased the coverage... I have to ask the details about this package, it is very strange sometimes.
@JosePizarro3 Thanks for the tips, I think I have addressed everything. Let me know if you think we are ready to consider merging. btw - have you applied ruff to this repo or do I need to do it manually? My auto-ruff formatting is not instigated for this repo, not sure if that is something that I need to address locally or something with the repo. |
So in the pyproject.toml |
3799690
to
c60c66c
Compare
Pull Request Test Coverage Report for Build 9367142112Details
💛 - Coveralls |
ok rebased and applied ruff manually (not sure what's going on there)...looks good? |
Yeah, please, merge. Maybe there is something off with your virtual environment and the rules applied (I am guessing some conflict on that direction). We can check it out in the office this week, it should be automatically applied when saving a file. |
cool, thanks a lot for all your help with this! |
No description provided.