guts-base 1.0.4__tar.gz → 1.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of guts-base might be problematic. Click here for more details.

Files changed (36) hide show
  1. {guts_base-1.0.4 → guts_base-1.0.5}/PKG-INFO +1 -1
  2. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/__init__.py +1 -1
  3. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/sim/base.py +9 -11
  4. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/sim/ecx.py +0 -5
  5. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/sim/report.py +0 -6
  6. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base.egg-info/PKG-INFO +1 -1
  7. {guts_base-1.0.4 → guts_base-1.0.5}/pyproject.toml +2 -2
  8. {guts_base-1.0.4 → guts_base-1.0.5}/LICENSE +0 -0
  9. {guts_base-1.0.4 → guts_base-1.0.5}/README.md +0 -0
  10. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/data/__init__.py +0 -0
  11. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/data/expydb.py +0 -0
  12. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/data/generator.py +0 -0
  13. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/data/openguts.py +0 -0
  14. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/data/preprocessing.py +0 -0
  15. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/data/survival.py +0 -0
  16. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/data/time_of_death.py +0 -0
  17. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/data/utils.py +0 -0
  18. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/mod.py +0 -0
  19. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/plot.py +0 -0
  20. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/prob.py +0 -0
  21. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/sim/__init__.py +0 -0
  22. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/sim/constructors.py +0 -0
  23. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/sim/mempy.py +0 -0
  24. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base/sim/utils.py +0 -0
  25. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base.egg-info/SOURCES.txt +0 -0
  26. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base.egg-info/dependency_links.txt +0 -0
  27. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base.egg-info/entry_points.txt +0 -0
  28. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base.egg-info/requires.txt +0 -0
  29. {guts_base-1.0.4 → guts_base-1.0.5}/guts_base.egg-info/top_level.txt +0 -0
  30. {guts_base-1.0.4 → guts_base-1.0.5}/setup.cfg +0 -0
  31. {guts_base-1.0.4 → guts_base-1.0.5}/tests/test_data_import.py +0 -0
  32. {guts_base-1.0.4 → guts_base-1.0.5}/tests/test_ecx.py +0 -0
  33. {guts_base-1.0.4 → guts_base-1.0.5}/tests/test_from_pymob.py +0 -0
  34. {guts_base-1.0.4 → guts_base-1.0.5}/tests/test_scripted_simulations.py +0 -0
  35. {guts_base-1.0.4 → guts_base-1.0.5}/tests/test_simulations.py +0 -0
  36. {guts_base-1.0.4 → guts_base-1.0.5}/tests/test_symbolic_solve.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: guts_base
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Basic GUTS model implementation in pymob
5
5
  Author-email: Florian Schunck <fluncki@protonmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -4,7 +4,7 @@ from . import data
4
4
  from . import prob
5
5
  from . import plot
6
6
 
7
- __version__ = "1.0.4"
7
+ __version__ = "1.0.5"
8
8
 
9
9
  from .sim import (
10
10
  GutsBase,
@@ -812,17 +812,15 @@ class GutsBase(SimulationBase):
812
812
  still be some problems down the line.
813
813
  """
814
814
  with warnings.catch_warnings(action="ignore"):
815
- # using the context manager here will not work, because it will prematurely
816
- # remove the tempdir and its contents. This interacts badly with netcdf files.
817
- # which are only transferred into memory when the contents are needed.
818
- tempdir = tempfile.TemporaryDirectory()
819
- self.export(directory=tempdir.name)
820
- print(os.listdir(tempdir.name))
821
- sim_copy = type(self).from_directory(tempdir.name)
822
-
823
- # set this attribute so that it can be cleaned up after the copied sim is
824
- # no longer necessary.
825
- sim_copy.tempdir = tempdir
815
+ # create the tempdir in the output path, because on the remote cluster
816
+ # the default temporary directory may not have enough space. Using the output
817
+ # path here resolves any path issues.
818
+ tmp_basedir = os.path.join(self.output_path, "tmp")
819
+ os.makedirs(tmp_basedir, exist_ok=True)
820
+ with tempfile.TemporaryDirectory(dir=tmp_basedir) as name:
821
+ self.export(directory=name)
822
+ print(f"Exported files ({name}):", os.listdir(name))
823
+ sim_copy = type(self).from_directory(name)
826
824
 
827
825
  return sim_copy
828
826
 
@@ -112,11 +112,6 @@ class ECxEstimator:
112
112
 
113
113
  self.condition_posterior_parameters(conditions=conditions_posterior)
114
114
 
115
- def __del__(self):
116
- if hasattr(self.sim, "tempdir"):
117
- self.sim.tempdir.cleanup()
118
-
119
-
120
115
  def _assert_posterior(self):
121
116
  try:
122
117
  p = self.sim.inferer.idata.posterior
@@ -105,12 +105,6 @@ class GutsReport(Report):
105
105
 
106
106
  ecx.append(ecx_estimator.results.copy(deep=True))
107
107
 
108
- # remove ecx_estimator to not blow up temp files.
109
- # This triggers the __del__ method of ECxEstimator,
110
- # which cleans up a temporary directory if it was
111
- # created during init
112
- del ecx_estimator
113
-
114
108
  results = pd.DataFrame(ecx)
115
109
  estimates[results.columns] = results
116
110
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: guts_base
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Basic GUTS model implementation in pymob
5
5
  Author-email: Florian Schunck <fluncki@protonmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "guts_base"
7
- version = "1.0.4"
7
+ version = "1.0.5"
8
8
  authors = [
9
9
  { name="Florian Schunck", email="fluncki@protonmail.com" },
10
10
  ]
@@ -49,7 +49,7 @@ import-openguts = "guts_base.data.openguts:create_database_and_import_data"
49
49
  convert-time-of-death-to-openguts = "guts_base.data.time_of_death:time_of_death_to_openguts"
50
50
 
51
51
  [tool.bumpver]
52
- current_version = "1.0.4"
52
+ current_version = "1.0.5"
53
53
  version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
54
54
  commit_message = "bump version {old_version} -> {new_version}"
55
55
  tag_message = "{new_version}"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes