Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated ignore #7

Merged
merged 13 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
686 changes: 0 additions & 686 deletions .THIS-IS-FOR-CONTAINER-DEV-ONLY

This file was deleted.

25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
buildImage.yaml
.python-version
__pycache__/
.idea/
*.ipynb_checkpoints/
dist/
.DS_Store
*.egg-info/
refresh-env.sh
smoldyn-2.72-mac/
build/
commit.sh
install.sh
push-image.sh
release.sh
run.sh
ray_job.sh
__pycache__
.pytest_cache
submit-biosimulators-container.sh
.vagrant
._vagrant
.THIS-IS-FOR-CONTAINER-DEV-ONLY
buildDockerImage.yml
.env

8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/biosimulator-processes.iml

This file was deleted.

116 changes: 0 additions & 116 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

33 changes: 16 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# TODO: Use a more specific tag instead of latest for reproducibility
FROM ubuntu:latest

ENV DEBIAN_FRONTEND=noninteractive \
XVFB_RES="1920x1080x24" \
XVFB_ARGS="" \
PATH="/app/.venv/bin:$PATH" \
CONFIG_ENV_FILE="/app/config/config.env" \
SECRET_ENV_FILE="/app/secret/secret.env" \
STORAGE_GCS_CREDENTIALS_FILE="/app/secret/gcs_credentials.json" \
STORAGE_LOCAL_CACHE_DIR="/app/scratch"
ENV DEBIAN_FRONTEND=noninteractive
# XVFB_RES="1920x1080x24" \
# XVFB_ARGS="" \
# PATH="/app/.venv/bin:$PATH" \
# CONFIG_ENV_FILE="/app/config/config.env" \
# SECRET_ENV_FILE="/app/secret/secret.env" \
# STORAGE_GCS_CREDENTIALS_FILE="/app/secret/gcs_credentials.json" \
# STORAGE_LOCAL_CACHE_DIR="/app/scratch"

WORKDIR /app

# copy and make dirs
COPY ./biosimulator_processes /app/biosimulator_processes
COPY ./notebooks /app/notebooks
COPY notebooks /app/notebooks

# copy files
COPY ./pyproject.toml ./poetry.lock ./data ./scripts/trust-notebooks.sh /app/
COPY ./scripts/xvfb-startup.sh /xvfb-startup.sh
COPY pyproject.toml poetry.lock ./data ./scripts/trust-notebooks.sh /app/
# COPY ./scripts/xvfb-startup.sh /xvfb-startup.sh

VOLUME /app/data

RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 \
ca-certificates \
python3-pip \
python3-dev \
build-essential \
Expand All @@ -43,20 +44,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libice6 \
libpython3.10 \
wget \
xvfb \
&& mkdir /tmp/.X11-unix \
&& chmod 1777 /tmp/.X11-unix \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --upgrade pip && pip install poetry \
&& poetry config virtualenvs.in-project true \
# && poetry run pip install psutil \
&& poetry update \
&& poetry install \
&& chmod +x ./trust-notebooks.sh \
&& ./trust-notebooks.sh \
&& rm ./trust-notebooks.sh
&& rm ./trust-notebooks.sh \
&& apt-get clean \
&& apt-get autoclean

CMD ["poetry", "run", "jupyter", "lab", "--port=8888", "--no-browser", "--allow-root"]
# CMD ["poetry", "run", "jupyter", "lab", "--port=8888", "--no-browser", "--allow-root"]


# PLEASE NOTE: We do not need to add a USER in the Dockerfile as Singularity will handle
Expand Down
Binary file modified biosimulator_processes/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified biosimulator_processes/__pycache__/data_model.cpython-310.pyc
Binary file not shown.
14 changes: 6 additions & 8 deletions biosimulator_processes/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class BaseModel(_BaseModel):

class ModelParameter(BaseModel):
name: str
feature: str
value: Union[float, int, str]
scope: str

Expand Down Expand Up @@ -197,15 +198,13 @@ class ProcessConfigSchema(BaseModel):
config: Dict = Field(default={})


class CopasiProcessConfigSchema(BaseModel):
class ProcessConfig(BaseModel):
process_name: str
method: str = Field(default='deterministic')
model: Union[TimeCourseModel, Dict]

def __init__(self, **data):
super().__init__(**data)
if isinstance(self.model, TimeCourseModel):
self.model = self.model.model_dump()

class CopasiProcessConfig(ProcessConfig):
method: str = Field(default='deterministic')
model: TimeCourseModel

# @field_serializer('model', when_used='json')
# @classmethod
Expand Down Expand Up @@ -234,7 +233,6 @@ class ProcessInstance(BaseModel):
config: Union[CopasiProcessConfigSchema, ProcessConfigSchema]
inputs: PortSchema
outputs: PortSchema
emitter: Union[EmitterInstance, NoneType] = Field(default=None)

@classmethod
@field_validator('address')
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions biosimulator_processes/processes/copasi_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# )
from process_bigraph import Process, Composite, pf
from biosimulator_processes.utils import fetch_biomodel
from biosimulator_processes.data_model import TimeCourseProcessConfigSchema
from biosimulator_processes.data_model import TimeCourseProcessConfigSchema, CopasiProcessConfig


class CopasiProcess(Process):
Expand Down Expand Up @@ -81,7 +81,7 @@ class CopasiProcess(Process):

config_schema = TimeCourseProcessConfigSchema().model_dump()

def __init__(self, config=None, core=None):
def __init__(self, config: CopasiProcessConfig=None, core=None):
super().__init__(config, core)

model_source = self.config['model']['model_source']['value']
Expand Down
Binary file not shown.
Binary file not shown.
15 changes: 7 additions & 8 deletions biosimulator_processes/steps/parameter_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def update(self, input):
pass


class DeterministicTimeCourseParameterScan(ParameterScan):
class DeterministicTimeCourseParameterScan(Step):
"""Using CopasiProcess as the primary TimeCourse simulator.

# TODO: enable multiple Simulator types.
Expand All @@ -61,20 +61,19 @@ class DeterministicTimeCourseParameterScan(ParameterScan):
used to run during update
"""
config_schema = {
'process_config': {
'_default': TimeCourseProcessConfigSchema().model_dump(),
'_type': 'tree[string]'},
'process_config': TimeCourseProcessConfigSchema().model_dump(),
'n_iterations': 'int',
'iter_stop': 'float',
'iter_start': 'maybe[float]',
'perturbation_magnitude': 'float',
'parameters': 'list[object]'}

def __init__(self, config=None):
super().__init__(config=config)
def __init__(self):
self.process = CopasiProcess(config=self.config.get('process_config'))
self.params_to_scan: List[ModelParameter] = self.config.get('parameters', [])
self.n_iterations = self.config['n_iterations']
self.iter_start = self.config.get('iter_start', 0.0)
self.iter_stop = self.config['iter_stop']


def initial_state(self):
Expand All @@ -98,8 +97,8 @@ def update(self, input):
results = {}
scan_range = np.linspace(
start=self.iter_start,
stop=self.n_iterations,
num=self.config['perturbation_magnitude']).tolist()
stop=self.iter_stop,
num=self.n_iterations).tolist()

for index, perturbed in enumerate(scan_range):
interval = input['time']
Expand Down
2 changes: 1 addition & 1 deletion commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ read -r msg
# echo "Notebooks not fixed."
# fi

poetry run python3 ./scripts/fix_notebooks.py
python3 ./scripts/fix_notebooks.py
git add --all
git commit -m "${msg}"
git push origin "${branch}"
Expand Down
Loading
Loading