-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix iterjobs() without database #1222
Conversation
@liamhuber It would be great if you can take another look at this pull request. It took far too long on my side but I definitely want to merge it soon, to move on. |
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 appreciate the comment above the magic-value list, I think that clarifies it perfectly.
Taking a deeper dive, there are a few things I still don't like about this PR:
-
It is made to patch a bug, but there is no change to the test suite. I can't tell it's fixing the bug without manually running the example in
iter_jobs()
fails without database #1221, and without a test we're not guaranteeing that this new and improved behaviour will stick around. -
The high-level
inspect
andload
calls get replaced with the low-levelload_from_jobpath
call. It didn't take much digging to see why --load
andinspect
don't acceptdb_entry
, but these high-level calls were created for a reason: to more clearly signify the intent of the action. Instead, let's empower them to also handle adb_entry
instead of a job specifier. -
By forcing
convert_to_object=True
in line 619, we are changing behaviour. This actually invalidates the signature ofiter_jobs
asconvert_to_object
becomes totally disused. I see the comment a couple lines above that we will deprecateconvert_to_object
...but deprecate it to what? Always false or always true? Now we're deprecating the variable, but the comment sticks around?? I don't know what the intended future behaviour is, but without clarifying that and updating the "backwards compatibility" comment, I'm not comfortable changing the behaviour.
I'm stacking a patching PR now that addresses all three of these concerns. EDIT: #1228
if not isinstance(self.db, FileTable): | ||
job_lst = [[job_id, None] for job_id in job_table["id"]] | ||
else: |
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.
Nit: it is a bit of a smell to if not isinstance(); else
instead of if isinstance(); else
as it increases cognitive load to mentally negate, but I also see the argument for putting the "default" case at the top so I want to point it out but am comfortable either way.
I agree - thanks for adding the test.
From my perspective there are two levels of APIs in pyiron, the user interface which we use interactively and the internal interface the different pyiron objects use to interact with each other. I do not expect a user to write the
This was a bug - that is fixed now. |
No description provided.