From 19c6d377f598563815f29ea2d2b2f447e098d5c2 Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Sun, 11 Feb 2024 22:33:24 +0100 Subject: [PATCH 1/2] expose task work dir --- src/ansys/hps/client/jms/resource/task.py | 4 ++++ src/ansys/hps/client/jms/schema/task.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/ansys/hps/client/jms/resource/task.py b/src/ansys/hps/client/jms/resource/task.py index 16ced3e7e..1066adaea 100644 --- a/src/ansys/hps/client/jms/resource/task.py +++ b/src/ansys/hps/client/jms/resource/task.py @@ -81,6 +81,8 @@ class Task(Object): ID of the license context in use. custom_data : dict, optional Dictionary type field for storing custom data. + working_directory : str, optional + Working directory of the task. """ class Meta: @@ -113,6 +115,7 @@ def __init__( owned_file_ids=missing, license_context_id=missing, custom_data=missing, + working_directory=missing, **kwargs ): self.id = id @@ -139,6 +142,7 @@ def __init__( self.owned_file_ids = owned_file_ids self.license_context_id = license_context_id self.custom_data = custom_data + self.working_directory = working_directory self.obj_type = self.__class__.__name__ diff --git a/src/ansys/hps/client/jms/schema/task.py b/src/ansys/hps/client/jms/schema/task.py index 15a279beb..7da760b2d 100644 --- a/src/ansys/hps/client/jms/schema/task.py +++ b/src/ansys/hps/client/jms/schema/task.py @@ -133,3 +133,8 @@ class Meta(ObjectSchemaWithModificationInfo.Meta): allow_none=True, metadata={"description": "Dictionary type field for storing custom data."}, ) + + working_directory = fields.String( + allow_none=True, + metadata={"description": "Working directory of the task."}, + ) From 7eda4d02371f150aa0fc0438c04a2eaeeb813fc2 Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Sun, 11 Feb 2024 22:33:52 +0100 Subject: [PATCH 2/2] improve contribute section --- doc/source/contribute.rst | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/doc/source/contribute.rst b/doc/source/contribute.rst index c2744abc2..e174a97d5 100644 --- a/doc/source/contribute.rst +++ b/doc/source/contribute.rst @@ -44,22 +44,14 @@ Installing PyHPS in developer mode allows you to modify and enhance the source: # Activate it in Windows Powershell .venv\Scripts\Activate.ps1 - -#. Ensure that you have the latest required build system and documentation, - testing, and CI tools: - - .. code:: bash - python -m pip install -U pip setuptools tox - python -m pip install -r requirements/requirements_build.txt - python -m pip install -r requirements/requirements_doc.txt - python -m pip install -r requirements/requirements_tests.txt - -#. Install the project in editable mode: +#. Install the package in editable mode with the required build system, documentation, + and testing tools: .. code:: bash - python -m pip install --editable . + python -m pip install -U pip setuptools tox + python -m pip install --editable .[tests,doc] #. Verify your development installation: @@ -150,6 +142,17 @@ the building requirements and then executing the build module: python -m twine check dist/* +Generate or update JMS resources +-------------------------------- + +To generate Job Management Service (JMS) resources from the corresponding schemas, run this command:: + + python generate_resources.py + +To apply code styling standards to the generated code, run this command:: + + pre-commit run --all-files + Generate or update RMS models -----------------------------