Skip to content

Commit

Permalink
Adding scaffolding for multi page app
Browse files Browse the repository at this point in the history
  • Loading branch information
JBris committed Sep 10, 2024
1 parent b1016d1 commit 170f783
Show file tree
Hide file tree
Showing 9 changed files with 1,584 additions and 18 deletions.
25 changes: 20 additions & 5 deletions app/flows/run_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from prefect.task_runners import ConcurrentTaskRunner

from deeprootgen.data_model import RootSimulationModel
from deeprootgen.io import save_graph_to_db
from deeprootgen.model import RootSystemSimulation
from deeprootgen.pipeline import (
begin_experiment,
Expand All @@ -23,7 +24,15 @@


@task
def run_abc() -> None:
def run_abc(input_parameters: RootSimulationModel, simulation_uuid: str) -> None:
"""Running Approximate Bayesian Computation.
Args:
input_parameters (RootSimulationModel):
The root simulation data model.
simulation_uuid (str):
The simulation uuid.
"""
print("hello")


Expand All @@ -32,7 +41,13 @@ def run_abc() -> None:
description="Perform Bayesian parameter estimation for the root model using Approximate Bayesian Computation.",
task_runner=ConcurrentTaskRunner(),
)
def run_abc_flow(
# input_params: RootSimulationModel
) -> None:
run_abc.submit()
def run_abc_flow(input_parameters: RootSimulationModel, simulation_uuid: str) -> None:
"""Flow for running Approximate Bayesian Computation.
Args:
input_parameters (RootSimulationModel):
The root simulation data model.
simulation_uuid (str):
The simulation uuid.
"""
run_abc.submit(input_parameters, simulation_uuid)
25 changes: 22 additions & 3 deletions app/flows/run_optimisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from prefect.task_runners import ConcurrentTaskRunner

from deeprootgen.data_model import RootSimulationModel
from deeprootgen.io import save_graph_to_db
from deeprootgen.model import RootSystemSimulation
from deeprootgen.pipeline import (
begin_experiment,
Expand All @@ -23,7 +24,17 @@


@task
def run_optimisation() -> None:
def run_optimisation(
input_parameters: RootSimulationModel, simulation_uuid: str
) -> None:
"""Running a optimisation procedure.
Args:
input_parameters (RootSimulationModel):
The root simulation data model.
simulation_uuid (str):
The simulation uuid.
"""
print("hello")


Expand All @@ -33,6 +44,14 @@ def run_optimisation() -> None:
task_runner=ConcurrentTaskRunner(),
)
def run_optimisation_flow(
# input_params: RootSimulationModel
input_parameters: RootSimulationModel, simulation_uuid: str
) -> None:
run_optimisation.submit()
"""Flow for running a optimisation procedure.
Args:
input_parameters (RootSimulationModel):
The root simulation data model.
simulation_uuid (str):
The simulation uuid.
"""
run_optimisation.submit(input_parameters, simulation_uuid)
25 changes: 22 additions & 3 deletions app/flows/run_sensitivity_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from prefect.task_runners import ConcurrentTaskRunner

from deeprootgen.data_model import RootSimulationModel
from deeprootgen.io import save_graph_to_db
from deeprootgen.model import RootSystemSimulation
from deeprootgen.pipeline import (
begin_experiment,
Expand All @@ -23,7 +24,17 @@


@task
def run_sensitivity_analysis() -> None:
def run_sensitivity_analysis(
input_parameters: RootSimulationModel, simulation_uuid: str
) -> None:
"""Running a sensitivity analysis.
Args:
input_parameters (RootSimulationModel):
The root simulation data model.
simulation_uuid (str):
The simulation uuid.
"""
print("hello")


Expand All @@ -33,6 +44,14 @@ def run_sensitivity_analysis() -> None:
task_runner=ConcurrentTaskRunner(),
)
def run_sensitivity_analysis_flow(
# input_params: RootSimulationModel
input_parameters: RootSimulationModel, simulation_uuid: str
) -> None:
run_sensitivity_analysis.submit()
"""Flow for running a sensitivity analysis.
Args:
input_parameters (RootSimulationModel):
The root simulation data model.
simulation_uuid (str):
The simulation uuid.
"""
run_sensitivity_analysis.submit(input_parameters, simulation_uuid)
25 changes: 20 additions & 5 deletions app/flows/run_snpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from prefect.task_runners import ConcurrentTaskRunner

from deeprootgen.data_model import RootSimulationModel
from deeprootgen.io import save_graph_to_db
from deeprootgen.model import RootSystemSimulation
from deeprootgen.pipeline import (
begin_experiment,
Expand All @@ -23,7 +24,15 @@


@task
def run_snpe() -> None:
def run_snpe(input_parameters: RootSimulationModel, simulation_uuid: str) -> None:
"""Running sequential neural posterior estimation.
Args:
input_parameters (RootSimulationModel):
The root simulation data model.
simulation_uuid (str):
The simulation uuid.
"""
print("hello")


Expand All @@ -32,7 +41,13 @@ def run_snpe() -> None:
description="Perform Bayesian parameter estimation for the root model using Sequential Neural Posterior Estimation.",
task_runner=ConcurrentTaskRunner(),
)
def run_snpe_flow(
# input_params: RootSimulationModel
) -> None:
run_snpe.submit()
def run_snpe_flow(input_parameters: RootSimulationModel, simulation_uuid: str) -> None:
"""Flow for running sequential neural posterior estimation.
Args:
input_parameters (RootSimulationModel):
The root simulation data model.
simulation_uuid (str):
The simulation uuid.
"""
run_snpe.submit(input_parameters, simulation_uuid)
Loading

0 comments on commit 170f783

Please sign in to comment.