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

Access Job ID within data generator #295

Open
SNMS95 opened this issue Feb 25, 2025 · 2 comments
Open

Access Job ID within data generator #295

SNMS95 opened this issue Feb 25, 2025 · 2 comments

Comments

@SNMS95
Copy link
Collaborator

SNMS95 commented Feb 25, 2025

If we only implemented the execute function, we have access to the ExperimentSample object which does not have an ID.
How can we then log information about the current JOB?

@mpvanderschelling
Copy link
Collaborator

Hi Surya,
In short; the ExperimentSample itself does not have an ID. It is when it is combined in an ExperimentData object that it gains an ID since the .data attribute of the ExperimentData is a dictionary like {id: ExperimentSample}.

Internally when iterating over the samples, we yield a tuple (id, ExperimentSample). When implementing your data-driven process with a Block, you have access to each ID when you for-loop over the experiment samples. When using the DataGenerator, you implement the local transformation of the sample. The store method of the ExperimentSample will make sure that on_disk objects are stored accordingly with their respective ID.

Hope that makes sense!

@mpvanderschelling
Copy link
Collaborator

I have added a optional argument to the .call function of a DataGenerator: pass_id: bool in v.2.0.1
This argument passed the ID number of the job to the execute function as a id key-word argument.
This enables you to extract the ID number for each execute call

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

No branches or pull requests

2 participants