Skip to content

Commit

Permalink
removing sciml references.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Szendrey committed Sep 18, 2024
1 parent d3e133c commit d5fccab
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ The service is a light wrapper service around [pyciemss](https://github.com/ciem
Both a FastAPI and RQ tasks are provided so jobs can be run asynchronously for long periods
of time. The service must also [conform to this spec](https://github.com/DARPA-ASKEM/simulation-api-spec).

Experimental: `sciml` engine can be chosen for `simulate`.

## Startup

To start the PyCIEMSS Simulation API, first run:
Expand Down
7 changes: 0 additions & 7 deletions service/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
optimize,
)

# jl = newmodule("SciMLIntegration")
# jl.seval("using SciMLIntegration, PythonCall")

logging.basicConfig()
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
Expand All @@ -27,17 +24,13 @@ def run(request, *, job_id):
logging.debug(f"STARTED {job_id} (user_id: {request.user_id})")
update_tds_status(job_id, status="running", start=True)

# if request.engine == "ciemss":
operation_name = request.__class__.pyciemss_lib_function
kwargs = request.gen_pyciemss_args(job_id)
logger.info(f"{job_id} started with the following args: {kwargs}")
if len(operation_name) == 0:
raise Exception("No operation provided in request")
else:
output = eval(operation_name)(**kwargs)
# else:
# operation = request.__class__.sciml_lib_function
# output = operation(job_id, jl)

attach_files(output, job_id)
cleanup_job_dir(job_id)
Expand Down
3 changes: 0 additions & 3 deletions service/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ class OperationRequest(BaseModel):
def gen_pyciemss_args(self, job_id):
raise NotImplementedError("PyCIEMSS cannot handle this operation")

def run_sciml_operation(self, job_id, julia_context):
raise NotImplementedError("SciML cannot handle this operation")

# @field_validator("engine")
# def must_be_ciemss(cls, engine_choice):
# if engine_choice != "ciemss":
Expand Down
7 changes: 0 additions & 7 deletions service/models/operations/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,5 @@ def gen_pyciemss_args(self, job_id):
**extra_options,
}

def run_sciml_operation(self, job_id, julia_context):
amr_path = fetch_model(self.model_config_id, job_id)
with open(amr_path, "r") as file:
amr = file.read()
result = julia_context.simulate(amr, self.timespan.start, self.timespan.end)
return {"data": julia_context.pytable(result)}

class Config:
extra = Extra.forbid

0 comments on commit d5fccab

Please sign in to comment.