-
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
[minor] Opt in hash for pythonfunction #1358
Conversation
Then fall back on super() otherwise, to further clarify the intent of the mangling
This percolated through the day, and I realized that in the wrapper function it would be much nicer to expose There's no time pressure for this PR, so I'll polish it on Monday. |
Tuesday, but anyhow done. You can force the wrapped job to have exactly the name you want like: job = pr.wrap_python_function(
some_function,
job_name="my_job", # Overrides default of using function name
automatically_rename=False, # Stops name mangling with input at save time
) |
Co-authored-by: Jan Janssen <[email protected]>
…_hashing_optional
That we broke by committing the readability suggestion
# Conflicts: # pyiron_base/jobs/flex/pythonfunctioncontainer.py # tests/flex/test_pythonfunctioncontainer.py
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.
Looks good to me
Super! I'm just adding a bit to the tests to improve coverage -- most of the codacy report is somehow catching old stuff that has nothing to do with this PR, but they did find a relevant branch of an |
Ok, so maybe this branch is honestly not doing what I hoped it would do. This is exactly #1367 cropping up, and I thought this clause stopped it.
|
Ahhh, right, this is actually perfectly sensible. The "don't save again if you find this job" clause is nested inside the Since the consensus in #1367 seems to be that we want all jobs to have this protection, I'll just de-indent the clause here so (as a start) this job always has the protection. Apart from making the coverage number better, this was actually my motivation for adding the test to start with -- I anticipate this snippet getting promoted so I wanted a test that could be pulled along with it. |
This changes the default behaviour of
PythonFunctionContainerJob
to not automatically rename jobs at save time;Project.wrap_python_function
still does by default, but it's now optionally exposed as a flag.This extends and polishes the ideas in #1356, but I wanted to break it apart separately since changing the default behaviour for the job class probably makes this a minor bump instead of a patch bump.