Skip to content

76: Add job reference and use it to determine output_esdl name.#77

Merged
lfse-slafleur merged 5 commits intomainfrom
76-add-job-reference-to-job-submission
Oct 15, 2024
Merged

76: Add job reference and use it to determine output_esdl name.#77
lfse-slafleur merged 5 commits intomainfrom
76-add-job-reference-to-job-submission

Conversation

@lfse-slafleur
Copy link
Copy Markdown
Member

No description provided.

elif job_reference == "":
output_energy_system.name = f"{input_energy_system.name}"
else:
output_energy_system.name = f"{input_energy_system.name}_{job_reference}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we replace invalid xml characters with _ for example?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch! Checked what happened when I inserted reserved characters in the job reference. Pyesdl already takes care of the necessary escaping:

<esdl:EnergySystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:esdl="http://www.tno.nl/esdl" id="c53b2878-6f0e-49fb-b9a1-9aeb8b808117" description="" name="Untitled EnergySystem with return network_example_sdk_client.simulator %&gt;&gt;&amp;#(@#)(@#$&lt;&gt;)(ASd&lt;&lt;&lt;&gt;&gt;&gt;&gt;&gt;" version="1" esdlVersion="v2207">

once the result is received and handled without exceptions through
`callback_on_finished`.
:param job_reference: An optional reference to the submitted job which is used in the
name of the output ESDL as well as in internal logging of OMOTES.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very nice to have it in the internal logging as well. This is to be implemented?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes! Originally meant for a more bare implementation to check if the implementation fits everyone. Logging introduced here: e670131

@lfse-slafleur lfse-slafleur marked this pull request as ready for review October 14, 2024 15:00
@lfse-slafleur lfse-slafleur requested a review from MarkTNO October 14, 2024 15:00
@lfse-slafleur lfse-slafleur merged commit 9585d2e into main Oct 15, 2024
@lfse-slafleur lfse-slafleur deleted the 76-add-job-reference-to-job-submission branch October 15, 2024 09:12
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 this pull request may close these issues.

Add job reference to job submission.

2 participants