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

Add meta DataContainer to GenericJob #731

Closed
wants to merge 1 commit into from
Closed

Add meta DataContainer to GenericJob #731

wants to merge 1 commit into from

Conversation

pmrv
Copy link
Contributor

@pmrv pmrv commented Mar 24, 2022

I sometimes want to tag jobs with certain extra information, e.g. want kind of atomic structure is used, where it is derived from etc. Right now I usually encode this in subprojects or the job name, but it can get convoluted and error-prone to retrieve it again (due to converting to and from strings), so I'd like a cleaner solution.

In this PR I've just added an extra DataContainer to GenericJob that saves anything a user might put, but otherwise does not touch it. There's a bit of danger that people start putting information there that is currently not tracked in pyiron, but really should be, e.g. something like this. I personally feel it's still a nice thing to have, but we should probably discuss this in the next pyiron meeting. Any thoughts already?

I'll add tests and such after our discussions.

@pmrv pmrv added the enhancement New feature or request label Mar 24, 2022
Comment on lines +1250 to +1253
try:
self._meta.from_hdf(self._hdf5)
except ValueError:
pass # no meta data written for this job previously
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be more elegant by checking if the corresponding group exists in the HDF5 file

@pmrv
Copy link
Contributor Author

pmrv commented Mar 28, 2022

Rename job.meta to job.data or project.data to project.meta. Conflict with job['user/foo']?

@stale
Copy link

stale bot commented Apr 13, 2022

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.

@stale stale bot added the stale label Apr 13, 2022
@stale
Copy link

stale bot commented Apr 27, 2022

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.

@stale stale bot added the stale label Apr 27, 2022
@liamhuber
Copy link
Member

@pmrv after recent meetings, shall we wait until GenericJob looks more like TemplateJob, then simply add a self.storage._meta = DataContainer(table_name='meta') and accompanying read-only-access property? I like this idea, but I think that's an easier time to make the change. We could even directly do it over in #758 as I feel it's very on-topic for that PR.

@stale stale bot removed the stale label May 25, 2022
@pmrv
Copy link
Contributor Author

pmrv commented May 25, 2022

@pmrv after recent meetings, shall we wait until GenericJob looks more like TemplateJob, then simply add a self.storage._meta = DataContainer(table_name='meta') and accompanying read-only-access property? I like this idea, but I think that's an easier time to make the change. We could even directly do it over in #758 as I feel it's very on-topic for that PR.

Yup, that sounds like a good idea. I'm not urgently depending on this change anyway.

@stale
Copy link

stale bot commented Jun 12, 2022

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.

@stale stale bot added the stale label Jun 12, 2022
@stale stale bot closed this Jun 27, 2022
@samwaseda samwaseda deleted the meta branch November 2, 2022 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants