guts-base 1.0.2__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.
- {guts_base-1.0.2 → guts_base-1.0.5}/PKG-INFO +1 -1
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/__init__.py +1 -1
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/sim/base.py +9 -11
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/sim/ecx.py +0 -5
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/sim/report.py +4 -7
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base.egg-info/PKG-INFO +1 -1
- {guts_base-1.0.2 → guts_base-1.0.5}/pyproject.toml +2 -2
- {guts_base-1.0.2 → guts_base-1.0.5}/LICENSE +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/README.md +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/data/__init__.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/data/expydb.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/data/generator.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/data/openguts.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/data/preprocessing.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/data/survival.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/data/time_of_death.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/data/utils.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/mod.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/plot.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/prob.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/sim/__init__.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/sim/constructors.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/sim/mempy.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base/sim/utils.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base.egg-info/SOURCES.txt +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base.egg-info/dependency_links.txt +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base.egg-info/entry_points.txt +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base.egg-info/requires.txt +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/guts_base.egg-info/top_level.txt +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/setup.cfg +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/tests/test_data_import.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/tests/test_ecx.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/tests/test_from_pymob.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/tests/test_scripted_simulations.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/tests/test_simulations.py +0 -0
- {guts_base-1.0.2 → guts_base-1.0.5}/tests/test_symbolic_solve.py +0 -0
|
@@ -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
|
-
#
|
|
816
|
-
#
|
|
817
|
-
#
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
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
|
|
@@ -14,6 +14,8 @@ from guts_base.sim.ecx import ECxEstimator
|
|
|
14
14
|
class GutsReport(Report):
|
|
15
15
|
ecx_estimates_times: List = [1, 2, 4, 10]
|
|
16
16
|
ecx_estimates_x: List = [0.1, 0.25, 0.5, 0.75, 0.9]
|
|
17
|
+
ecx_draws: int = 250
|
|
18
|
+
ecx_force_draws: bool = False
|
|
17
19
|
set_background_mortality_to_zero = True
|
|
18
20
|
|
|
19
21
|
def additional_reports(self, sim: "SimulationBase"):
|
|
@@ -96,18 +98,13 @@ class GutsReport(Report):
|
|
|
96
98
|
|
|
97
99
|
ecx_estimator.estimate(
|
|
98
100
|
mode=sim.ecx_mode,
|
|
99
|
-
draws=
|
|
101
|
+
draws=self.ecx_draws,
|
|
102
|
+
force_draws=self.ecx_force_draws,
|
|
100
103
|
show_plot=False
|
|
101
104
|
)
|
|
102
105
|
|
|
103
106
|
ecx.append(ecx_estimator.results.copy(deep=True))
|
|
104
107
|
|
|
105
|
-
# remove ecx_estimator to not blow up temp files.
|
|
106
|
-
# This triggers the __del__ method of ECxEstimator,
|
|
107
|
-
# which cleans up a temporary directory if it was
|
|
108
|
-
# created during init
|
|
109
|
-
del ecx_estimator
|
|
110
|
-
|
|
111
108
|
results = pd.DataFrame(ecx)
|
|
112
109
|
estimates[results.columns] = results
|
|
113
110
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "guts_base"
|
|
7
|
-
version = "1.0.
|
|
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.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|