Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 9c0ec0e

Browse files
committed
fix: adjusted fig size for verification plots and updated return
1 parent 931c6aa commit 9c0ec0e

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ NOTES
1818
scratch.ipynb
1919
demos/.ipynb_checkpoints/
2020
.ipynb_checkpoints/
21-
NOTES
22-
.pytest_cache
21+
.DS_Store
22+
.pytest_cache
23+
test_archive.ipynb

bio_compose/data_model.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ class RequestError:
1919

2020
def to_dict(self):
2121
return asdict(self)
22+
23+
24+
class DynamicJson:
25+
def __init__(self, data: Dict[Any, Any]):
26+
"""
27+
Dynamically create a JSON-like object from a dictionary/mapping of any shape.
28+
"""
29+
for key, value in data.items():
30+
if isinstance(value, dict):
31+
value = DynamicData(value)
32+
setattr(self, key, value)
33+
34+
def __repr__(self):
35+
return f"{self.__dict__}"
2236

2337

2438
class Api(object):

bio_compose/verifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def visualize_observables(self, job_id: str, hspace: float = 0.25, use_grid: boo
298298
n_simulators = len(simulators)
299299

300300
# create subplots
301-
fig, axes = plt.subplots(nrows=n_simulators, ncols=1, figsize=(15, 5 * n_simulators))
301+
fig, axes = plt.subplots(nrows=n_simulators, ncols=1, figsize=(4, 3 * n_simulators))
302302

303303
# if only one simulator, `axes` won't be an array, so make it an array
304304
if n_simulators == 1:
@@ -465,7 +465,7 @@ def __init__(self, data: dict):
465465
self.job_id = self.data.get('content').get('job_id')
466466
self.verifier = Verifier()
467467

468-
def get_rmse(self, save_dest: str = None, fig_dimensions: tuple[int, int] = None, color_mapping: list[str] = None):
468+
def get_comparison(self, save_dest: str = None, fig_dimensions: tuple[int, int] = None, color_mapping: list[str] = None):
469469
"""
470470
Visualize the root-mean-squared error between simulator verification outputs as a heatmap.
471471

0 commit comments

Comments
 (0)