-
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
Add Outputs
base class
#29
Conversation
(please, disregard the failing pipeline; tests are passing locally) |
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.
Just some minor points, but I agree with most of the approach.
src/nomad_simulations/outputs.py
Outdated
def check_is_derived(self, is_derived: bool, outputs_ref) -> Optional[bool]: | ||
if not is_derived: | ||
if outputs_ref is not None: | ||
return True | ||
return False | ||
elif is_derived and outputs_ref is not None: | ||
return True | ||
return None | ||
|
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.
Not sure if I follow the logic here (maybe also add a small pydocs):
This function is used to set is_derived
, correct?
If is_derived
is already set (i.e. is not None
), only then it should trigger.
Moreover, if outputs_ref
fully covers is_derived
, then you don't need the latter.
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.
One more point, I'm going to ask Area D for "write-protected" quantities, i.e. if the value has been set, it can't be updated. This would help make the normalization leaner.
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.
No, because it might be missing outputs_ref
, hence the None
return describes the "missing refs" case. I added a better description after you reviewed it, sorry.
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.
Okay, but let's run over the possible scenarios:
- both
outputs_ref
andis_derived
are set, no issue - only
outputs_ref
is set: you can setis_derived = True
, but no additional information is conveyed is_derived = True
andoutputs_ref = None
: when would this happen?
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.
For number 3., maybe some wrong setting of is_derived
or some missing outputs_ref
when normalizing? In this case, return None
is happening
Added Nathan comments
Just finished some first version, feel free to do another review. You can also resolve threads when you feel you satisfied with the resolutions. |
44bfa2c
to
4ef24ea
Compare
4ef24ea
to
415c685
Compare
Pull Request Test Coverage Report for Build 8523567766Details
💛 - Coveralls |
Adding base class for outputs and the unit testing. Testing is a bit empty, but I guess we will see more once we implement other cases.