From 756ded489cfac1a20615104b99d5b66331e0f7d9 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 11:15:44 +0100 Subject: [PATCH 01/10] bump signac versions --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a2762618..aae606a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,8 +17,8 @@ requires-python = ">=3.6" dependencies = [ "click", "PyYAML", - "signac==1.8.0", - "signac-flow==0.23.0", + "signac==2.2.0", + "signac-flow==0.26.1", "GitPython==3.1.31", "pandas", "DeepDiff", From e86be79a5046a25d71b0b41afc404e6b6c173b8f Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 11:17:27 +0100 Subject: [PATCH 02/10] bump signac version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aae606a3..df18bcf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ requires-python = ">=3.6" dependencies = [ "click", "PyYAML", - "signac==2.2.0", + "signac==2.1.0", "signac-flow==0.26.1", "GitPython==3.1.31", "pandas", From 7ec588a5400c15d25b24a38da41c353c9d357de0 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 11:23:20 +0100 Subject: [PATCH 03/10] fix import --- src/obr/OpenFOAM/case.py | 2 +- src/obr/core.py | 1 + src/obr/core/core.py | 2 +- src/obr/core/queries.py | 9 +++++---- src/obr/create_tree.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 src/obr/core.py diff --git a/src/obr/OpenFOAM/case.py b/src/obr/OpenFOAM/case.py index 21c5a9ae..c7a418ce 100644 --- a/src/obr/OpenFOAM/case.py +++ b/src/obr/OpenFOAM/case.py @@ -6,7 +6,7 @@ from subprocess import check_output import re from ..core.core import logged_execute, logged_func, modifies_file, path_to_key -from signac.contrib.job import Job +from signac.job import Job from .BlockMesh import BlockMesh, calculate_simple_partition from datetime import datetime from Owls.parser.FoamDict import FileParser diff --git a/src/obr/core.py b/src/obr/core.py new file mode 100644 index 00000000..e5a0d9b4 --- /dev/null +++ b/src/obr/core.py @@ -0,0 +1 @@ +#!/usr/bin/env python3 diff --git a/src/obr/core/core.py b/src/obr/core/core.py index 6bab9c2b..582453f5 100644 --- a/src/obr/core/core.py +++ b/src/obr/core/core.py @@ -10,7 +10,7 @@ from subprocess import check_output from typing import Union, Generator from datetime import datetime -from signac.contrib.job import Job +from signac.job import Job from copy import deepcopy # these are to be replaced with each other diff --git a/src/obr/core/queries.py b/src/obr/core/queries.py index 34ed88f5..c65607bc 100644 --- a/src/obr/core/queries.py +++ b/src/obr/core/queries.py @@ -1,10 +1,11 @@ -from dataclasses import dataclass, field -from typing import Any, Union, Callable, Iterable -from copy import deepcopy import re import logging -from signac.contrib.job import Job import pandas as pd + +from dataclasses import dataclass, field +from typing import Any, Union, Callable, Iterable +from copy import deepcopy +from signac.job import Job from typing import TYPE_CHECKING, Union from enum import Enum diff --git a/src/obr/create_tree.py b/src/obr/create_tree.py index ac7bb835..893cf9dd 100644 --- a/src/obr/create_tree.py +++ b/src/obr/create_tree.py @@ -22,7 +22,7 @@ from collections.abc import MutableMapping from pathlib import Path from subprocess import check_output -from signac.contrib.job import Job +from signac.job import Job from obr.signac_wrapper.operations import OpenFOAMProject from copy import deepcopy From 5ab3775eb7de94c2d2566cb91c9b4087ab3159e9 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 11:25:04 +0100 Subject: [PATCH 04/10] fix import --- src/obr/signac_wrapper/operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/obr/signac_wrapper/operations.py b/src/obr/signac_wrapper/operations.py index 8c6bddfb..5c5fdda2 100644 --- a/src/obr/signac_wrapper/operations.py +++ b/src/obr/signac_wrapper/operations.py @@ -9,7 +9,7 @@ from ..core.core import execute from .labels import owns_mesh, final, finished from obr.OpenFOAM.case import OpenFOAMCase -from signac.contrib.job import Job +from signac.job import Job from typing import Union, Literal from datetime import datetime import logging From be6c35466e78d104f7db242a54cc6a85d303ff06 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 11:33:12 +0100 Subject: [PATCH 05/10] fix init_project --- src/obr/cli.py | 2 +- tests/test_create_tree.py | 8 ++++---- tests/test_md5sum.py | 2 +- tests/test_queries.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/obr/cli.py b/src/obr/cli.py index c2ba995e..afa50c1e 100644 --- a/src/obr/cli.py +++ b/src/obr/cli.py @@ -341,7 +341,7 @@ def init(ctx: click.Context, **kwargs): if kwargs.get("verbose", 0) >= 1: logging.info(config) - project = OpenFOAMProject.init_project(root=kwargs["folder"]) + project = OpenFOAMProject.init_project(path=kwargs["folder"]) create_tree(project, config, kwargs) logging.info("successfully initialised") diff --git a/tests/test_create_tree.py b/tests/test_create_tree.py index 82ee5098..562be6e7 100644 --- a/tests/test_create_tree.py +++ b/tests/test_create_tree.py @@ -93,7 +93,7 @@ def open_job(self, statepoint): def test_create_tree(tmpdir, emit_test_config): - project = OpenFOAMProject.init_project(root=tmpdir) + project = OpenFOAMProject.init_project(path=tmpdir) create_tree(project, emit_test_config, {"folder": tmpdir}, skip_foam_src_check=True) @@ -120,7 +120,7 @@ def test_create_tree(tmpdir, emit_test_config): def test_call_generate_tree(tmpdir, emit_test_config): - project = OpenFOAMProject.init_project(root=tmpdir) + project = OpenFOAMProject.init_project(path=tmpdir) workspace_dir = tmpdir / "workspace" view_dir = tmpdir / "view" @@ -148,7 +148,7 @@ def test_call_generate_tree(tmpdir, emit_test_config): def test_cache_folder(tmpdir, emit_test_config): emit_test_config["case"]["cache_folder"] = f"{tmpdir}/tmp" - project = OpenFOAMProject.init_project(root=tmpdir) + project = OpenFOAMProject.init_project(path=tmpdir) create_tree(project, emit_test_config, {"folder": tmpdir}, skip_foam_src_check=True) @@ -169,7 +169,7 @@ def test_cache_folder(tmpdir, emit_test_config): Path(f"{tmpdir}/tmp/test").touch() shutil.rmtree(workspace_dir) os.remove(f"{tmpdir}/signac.rc") - project = OpenFOAMProject.init_project(root=tmpdir) + project = OpenFOAMProject.init_project(path=tmpdir) create_tree(project, emit_test_config, {"folder": tmpdir}, skip_foam_src_check=True) project.run(names=["fetchCase"]) diff --git a/tests/test_md5sum.py b/tests/test_md5sum.py index 901b8dd7..7bec3391 100644 --- a/tests/test_md5sum.py +++ b/tests/test_md5sum.py @@ -35,7 +35,7 @@ def emit_test_config(): def test_md5sum_calculation(tmpdir, emit_test_config): - project = OpenFOAMProject.init_project(root=tmpdir) + project = OpenFOAMProject.init_project(path=tmpdir) create_tree(project, emit_test_config, {"folder": tmpdir}, skip_foam_src_check=True) diff --git a/tests/test_queries.py b/tests/test_queries.py index 7a639ea9..47f856dc 100644 --- a/tests/test_queries.py +++ b/tests/test_queries.py @@ -134,7 +134,7 @@ def get_project(tmpdir): } os.chdir(tmpdir) - project = OpenFOAMProject.init_project(root=tmpdir) + project = OpenFOAMProject.init_project(path=tmpdir) create_tree(project, config, {"folder": tmpdir}, skip_foam_src_check=True) project.run(names=["fetchCase"]) return project From ce5d4215fa5927af5cd319637deb0488731d2d3c Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 11:37:05 +0100 Subject: [PATCH 06/10] fix import --- src/obr/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/obr/cli.py b/src/obr/cli.py index afa50c1e..e31a02f6 100644 --- a/src/obr/cli.py +++ b/src/obr/cli.py @@ -23,7 +23,7 @@ import json import logging -from signac.contrib.job import Job +from signac.job import Job from .signac_wrapper.operations import OpenFOAMProject, get_values, OpenFOAMCase from .create_tree import create_tree from .core.parse_yaml import read_yaml From 5d07becf9733030f435a1c25c21fcda9eb73eae7 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 11:45:22 +0100 Subject: [PATCH 07/10] fix path argument --- src/obr/signac_wrapper/operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/obr/signac_wrapper/operations.py b/src/obr/signac_wrapper/operations.py index 5c5fdda2..1196d799 100644 --- a/src/obr/signac_wrapper/operations.py +++ b/src/obr/signac_wrapper/operations.py @@ -112,7 +112,7 @@ def basic_eligible(job: Job, operation: str) -> bool: def parent_job_is_ready(job: Job) -> str: """Checks whether the parent of the given job is ready""" if job.sp().get("parent_id"): - project = OpenFOAMProject.get_project(root=job.path + "/../..") + project = OpenFOAMProject.get_project(path=job.path + "/../..") parent_job = project.open_job(id=job.sp().get("parent_id")) return parent_job.doc["state"].get("global", "") return "" From 82166e7911c4e7b14673b75ee1b02aefb18747b8 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 11:49:19 +0100 Subject: [PATCH 08/10] .signacrc does not exist anymore --- tests/test_create_tree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_create_tree.py b/tests/test_create_tree.py index 562be6e7..164fe917 100644 --- a/tests/test_create_tree.py +++ b/tests/test_create_tree.py @@ -168,7 +168,7 @@ def test_cache_folder(tmpdir, emit_test_config): # after purgin and recreating the workspace, the cache folder should be used Path(f"{tmpdir}/tmp/test").touch() shutil.rmtree(workspace_dir) - os.remove(f"{tmpdir}/signac.rc") + shutil.rmtree(tmpdir /".signac") project = OpenFOAMProject.init_project(path=tmpdir) create_tree(project, emit_test_config, {"folder": tmpdir}, skip_foam_src_check=True) project.run(names=["fetchCase"]) From 47eb2c20a8242a6d3b8fcbcfff8419fd3cf0dae0 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Tue, 26 Dec 2023 12:53:25 +0100 Subject: [PATCH 09/10] add changelog entry, bump version --- CHANGELOG.rst | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d2c85719..8df36c8d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,7 @@ Changelog - Fix missing of groups in `obr run --list-operations` view, see https://github.com/hpsim/OBR/pull/159. - Make view folders relative see https://github.com/hpsim/OBR/pull/164 - Use cached version of git repo instead of cloning, see https://github.com/hpsim/OBR/pull/166 +- Bump signac version, see https://github.com/hpsim/OBR/pull/169 0.2.0 (2023-09-14) ------------------ diff --git a/pyproject.toml b/pyproject.toml index df18bcf0..95bf5544 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "obr" -version = "0.3.3" +version = "0.3.4" description = "A tool to create and run OpenFOAM parameter studies" authors = [ {name = "Gregor Olenik", email = "go@hpsim.de"}, From cf7c8a9b644f3e66b365e1e36f66e922ccce8d26 Mon Sep 17 00:00:00 2001 From: PeterBot Date: Sat, 30 Dec 2023 08:39:48 +0000 Subject: [PATCH 10/10] Format files Co-authored-by: Gregor Olenik --- src/obr/cli.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/obr/cli.py b/src/obr/cli.py index 7ccd8a2a..ae30d68f 100644 --- a/src/obr/cli.py +++ b/src/obr/cli.py @@ -40,7 +40,6 @@ from .core.core import map_view_folder_to_job_id - def check_cli_operations( project: OpenFOAMProject, operations: list[str], list_operations: Optional[Any] ) -> bool: