Skip to content

Commit

Permalink
Merge pull request #50 from voetberg/bones
Browse files Browse the repository at this point in the history
Update pr with all bones updates, update linter to fix check results
  • Loading branch information
voetberg authored Apr 4, 2024
2 parents 87a2e42 + d9ed3b0 commit 6f75e41
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install ruff
- name: Lint code
run: flake8 .
run: ruff check --fix

# Add other steps as needed, such as running additional linters or formatters
2 changes: 1 addition & 1 deletion src/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def _load_simulator(self, name):
try:
simulator_path = os.environ[f"{Defaults['common']['sim_location']}:{name}"]
except KeyError as e:
raise RuntimeError(f"Simulator cannot be found using env var {e}. Hint: have you registed your simulation with utils.register_simulator?")
raise RuntimeError(f"Simulator cannot be found using env var {e}. Hint: have you registered your simulation with utils.register_simulator?")

new_class = os.path.dirname(simulator_path)
sys.path.insert(1, new_class)
Expand Down
4 changes: 0 additions & 4 deletions src/plots/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from typing import TypeVar
from src.plots.plot import Display

display = TypeVar("display", Display)
Plots = {

}
13 changes: 5 additions & 8 deletions src/plots/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
import matplotlib.pyplot as plt
from matplotlib import rcParams

from src.data import data
from src.models import model

from src.utils.config import get_item, get_section
from utils.config import get_item, get_section

class Display:
def __init__(self, model:model, data:data, save:bool, show:bool, out_path:Optional[str]):
def __init__(self, model, data, save:bool, show:bool, out_path:Optional[str]):
self.save = save
self.show = show
self.out_path = out_path.rstrip("/")
if self.save:
assert self.out_path is not None, "out_path required to save files."

if not os.path.exists(os.path.dirname(out_path)):
os.makedirs(os.path.dirname(out_path))

if not os.path.exists(os.path.dirname(out_path)):
os.makedirs(os.path.dirname(out_path))
self.model = model
self._data_setup(data)
self._common_settings()
Expand Down
6 changes: 3 additions & 3 deletions src/utils/defaults.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Defaults = {
"common":{
"out_dir":"./DeepDiagonisticsResources/results/",
"temp_config": "./DeepDiagonisticsResources/temp/temp_config.yml",
"sim_location": "DeepDiagonisticsResources_Simulators"
"out_dir":"./DeepDiagnosticsResources/results/",
"temp_config": "./DeepDiagnosticsResources/temp/temp_config.yml",
"sim_location": "DeepDiagnosticsResources_Simulators"
},
"model": {
"model_engine": "SBIModel"
Expand Down

0 comments on commit 6f75e41

Please sign in to comment.