-
Notifications
You must be signed in to change notification settings - Fork 14
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
Job factory call #495
Job factory call #495
Conversation
And a bit of streamlining for handling the conda env resource paths
...now it seems to be working on Windows? But something else broke. Also removed an old debug print I found in the archiving tests, which are, presumably, debugged.
And bask in the glory of having squashed a pain-in-the-ass OS-dependent test bug.
As far as I can tell the *only* place it was used was in the old tests
It doesn't seem to do anything.
The default file was always getting backed up, but previously if the test failed it never got restored.
Now that the settings singleton is not special, we only need one of them
Only leveraged it for the project so far. Also this introduced a bug in script jobs which are seeing weird settings, but someone it's *only* scriptjob that's having trouble
Ok, this is some deep magic I don't fully understand. Our Singletons are only single (if I understand) within a particular *python* instance. When I run the script job, it seems to be starting a *second* python instance with a *new* set of settings. I figured it out be changing the default behaviour to `project_check_enable=False` and seeing that it worked, but instead of messing with the defaults for now I'll just force the behaviour in the test. So what's the deep magic about this? Well, for starters, if I run *only* the tests in `test_script.py` it works fine even without this patch, and it only fails when I run *all* the tests. This implies to me that script job is/isn't running on a new intpreter process depending where I start the tests from. Second, it worked *before*, so I have to assume that before it was somehow correctly reading the settings *even on this new python process*, and I really don't understand what I could have changed that stopped this from working. My take home lesson is that we need to keep working on this corner of the code base, because we shouldn't be messing around with behaviour this complex, it's dangerous.
It would be a bit safer with @classmethod@property so these attributes couldn't get overwritten, but this is only possible in python >=3.9, and in the lower versions an equivalent implementation is hella ugly (https://stackoverflow.com/questions/128573/using-property-on-classmethods), so for now just live a little bit on the dangerous side.
Previously we stored strings which were the path to the module containing the job. That functionality is preserved here (although I don't think it's used anywhere anymore???) but we can also exploit a job class dict that's directly name:class.
# Conflicts: # pyiron_base/project/generic.py
I'm a little confused why this is still showing up as so many commits...most of them got merged to master in #486, and master since got merged into this. Anyhow, the diff at least is correct that it's only a couple files changing. |
In principle, for classes passed as strings, it could be re-written to make use of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@niklassiemer bump |
Thanks, I was already bumped by the stale bot 😅 |
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.
Other than the small nit about the job_name
handling this LGTM.
And I just realized a failing
I triggered a new execution. |
Co-authored-by: Niklas Siemer <70580458+niklassiemer@users.noreply.github.com>
Super thanks! Good catches; I'll add them tomorrow and merge (provided there is no further complication with the hung test) |
OSX failure:
I don't think either this nor the Murnaghan error are related to the changes here though. |
Indeed, it is definitely not. Further, I don't get that issue on my OSX machine. |
All tests passing after most recent master merge. |
During @jan-janssen's excellent thesis presentation (🥳 🥳 🥳 ) I really enjoyed seeing all the shiniest pyiron syntax, but during one of the loops I saw we still have
pr.create_job('ScriptJob', 'foo')
. This doesn't quite deprecate that, because we don't yet overloadcreate
with all the various toolkits, but it does let us do syntax likepr.base.job('ScriptJob', 'foo')
,pr.atomistics.job('Lammps', 'bar')
, etc, which is super convenient for loops over job types. And if/when we getcreate
andcreate.job
overloaded it should trivially extend topr.create.job('SomeNewJobType', 'baz')
.EDIT: Following @niklassiemer's suggestion you can also do
pr.create.job(ScriptJob, 'foo')
orpr.create.job(MyRandomChildOfGenericJob, 'bar')
.