From 51a433790e834832a5e800d768e116be23f7d7a8 Mon Sep 17 00:00:00 2001 From: Matt Field Date: Thu, 20 Feb 2025 08:34:49 +0000 Subject: [PATCH] fixed bug where None.closed file is created if closing a non initialized run --- poetry.lock | 10 ++++++---- simvue/run.py | 6 +++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 574bac78..ed998f4c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1320,22 +1320,22 @@ files = [ [[package]] name = "narwhals" -version = "1.26.0" +version = "1.27.1" description = "Extremely lightweight compatibility layer between dataframe libraries" optional = true python-versions = ">=3.8" groups = ["main"] markers = "python_version <= \"3.11\" and extra == \"plot\" or python_version >= \"3.12\" and extra == \"plot\"" files = [ - {file = "narwhals-1.26.0-py3-none-any.whl", hash = "sha256:4af8bbdea9e45638bb9a981568a8dfa880e40eb7dcf740d19fd32aea79223c6f"}, - {file = "narwhals-1.26.0.tar.gz", hash = "sha256:b9d7605bf1d97a9d87783a69748c39150964e2a1ab0e5a6fef3e59e56772639e"}, + {file = "narwhals-1.27.1-py3-none-any.whl", hash = "sha256:71e4a126007886e3dd9d71d0d5921ebd2e8c1f9be9c405fe11850ece2b066c59"}, + {file = "narwhals-1.27.1.tar.gz", hash = "sha256:68505d0cee1e6c00382ac8b65e922f8b694a11cbe482a057fa63139de8d0ea03"}, ] [package.extras] core = ["duckdb", "pandas", "polars", "pyarrow", "pyarrow-stubs"] cudf = ["cudf (>=24.10.0)"] dask = ["dask[dataframe] (>=2024.8)"] -dev = ["covdefaults", "hypothesis", "pre-commit", "pytest", "pytest-cov", "pytest-env", "pytest-randomly", "typing-extensions"] +dev = ["covdefaults", "hypothesis", "mypy (>=1.15.0,<1.16.0)", "pandas-stubs", "pre-commit", "pytest", "pytest-cov", "pytest-env", "pytest-randomly", "typing-extensions"] docs = ["black", "duckdb", "jinja2", "markdown-exec[ansi]", "mkdocs", "mkdocs-autorefs", "mkdocs-material", "mkdocstrings[python]", "pandas", "polars (>=1.0.0)", "pyarrow"] duckdb = ["duckdb (>=1.0)"] extra = ["scikit-learn"] @@ -1345,6 +1345,8 @@ pandas = ["pandas (>=0.25.3)"] polars = ["polars (>=0.20.3)"] pyarrow = ["pyarrow (>=11.0.0)"] pyspark = ["pyspark (>=3.5.0)"] +tests = ["covdefaults", "hypothesis", "pytest", "pytest-cov", "pytest-env", "pytest-randomly", "typing-extensions"] +typing = ["mypy (>=1.15.0,<1.16.0)", "pandas-stubs", "typing-extensions"] [[package]] name = "numpy" diff --git a/simvue/run.py b/simvue/run.py index 6906ab74..5bfda8b3 100644 --- a/simvue/run.py +++ b/simvue/run.py @@ -1521,7 +1521,11 @@ def _tidy_run(self) -> None: self._dispatcher.purge() self._dispatcher.join() - if self._user_config.run.mode == "offline" and self._status != "created": + if ( + self._sv_obj + and self._user_config.run.mode == "offline" + and self._status != "created" + ): self._user_config.offline.cache.joinpath( "runs", f"{self._id}.closed" ).touch()