Skip to content
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

PythonTemplateJob won't work, throwing AttributeError on DataContainer construction #12

Open
s4b7r opened this issue Dec 1, 2022 · 2 comments · May be fixed by #13
Open

PythonTemplateJob won't work, throwing AttributeError on DataContainer construction #12

s4b7r opened this issue Dec 1, 2022 · 2 comments · May be fixed by #13

Comments

@s4b7r
Copy link

s4b7r commented Dec 1, 2022

Hi there,

@muh-hassani @samwaseda

I was recently trying to use https://github.com/materialdigital/PMD-workflow-workshop/blob/416e79550a067e8134673a092020cd21e1802120/2_customized_job/2_0_custom_python_job.ipynb as a basis to integrate a Python job into pyiron. However, without any modifications the example throws errors in my environment. On creating the job job=pr.create_job(... I get AttributeError: can't set attribute on self.input=DataContainer(table_name='inputs') in harmonicEnergy.__init__(. (that's the end of the stack trace: previous steps are Project.create_job and JobType.__new__)

Has the behaviour of pyiron changed in this regard since the workshop?

My current testing env. is
pyiron=0.4.6
pyiron-data=0.0.17
pyiron_atomistics=0.2.39
pyiron_base=0.5.12

Best

@jan-janssen
Copy link
Member

Hi @s4b7r,

The DataConainer class is now part of the pyiron TemplateJob, so you can just remove the init function:

    # def __init__(self, project, job_name):
    #     super(harmonicEnergy, self).__init__(project, job_name)
    #     self._input=DataContainer(table_name='inputs')

But I agree we should update the examples to be consistent with the latest pyiron version.

Best,

Jan

@jan-janssen jan-janssen linked a pull request Dec 1, 2022 that will close this issue
@s4b7r
Copy link
Author

s4b7r commented Dec 7, 2022

Thanks Jan, that will do the trick.
Keeping this issue open, to be closed by @jan-janssen 's pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants