Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
updated model params for datamodel
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Mar 1, 2024
1 parent 93944fd commit e218542
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
9 changes: 5 additions & 4 deletions biosimulator_processes/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class Model(BaseModel):
model_language: str = Field(default='sbml')
model_name: str = Field(default='Unnamed Composite Process Model')
model_changes: ModelChanges
model_units: Union[Dict[str, str], None] = None

@field_validator('model_source')
@classmethod
Expand Down Expand Up @@ -261,7 +262,7 @@ class SedModel(FromDict):
# The first 3 params are NOT optional below for a Model in SEDML. model_source has been adapted to mean point of residence
MODEL_TYPE = {
'model_id': 'string',
'model_source': 'string', # could be used as the "model_file" or "biomodel_id" below (SEDML l1V4 uses URIs); what if it was 'model_source': 'sbml:model_filepath' ?
'model_source': 'dict[string]', # 'string', # could be used as the "model_file" or "biomodel_id" below (SEDML l1V4 uses URIs); what if it was 'model_source': 'sbml:model_filepath' ?
'model_language': { # could be used to load a different model language supported by COPASI/basico
'_type': 'string',
'_default': 'sbml' # perhaps concatenate this with 'model_source'.value? I.E: 'model_source': 'MODEL_LANGUAGE:MODEL_FILEPATH' <-- this would facilitate verifying correct model fp types.
Expand All @@ -271,9 +272,9 @@ class SedModel(FromDict):
'_default': 'composite_process_model'
},
'model_changes': {
'species_changes': 'tree[string]', # <-- this is done like set_species('B', kwarg=) where the inner most keys are the kwargs
'global_parameter_changes': 'tree[string]', # <-- this is done with set_parameters(PARAM, kwarg=). where the inner most keys are the kwargs
'reaction_changes': 'tree[string]'
'species_changes': 'maybe[tree[string]]', # <-- this is done like set_species('B', kwarg=) where the inner most keys are the kwargs
'global_parameter_changes': 'maybe[tree[string]]', # <-- this is done with set_parameters(PARAM, kwarg=). where the inner most keys are the kwargs
'reaction_changes': 'maybe[tree[string]]'
},
'model_units': 'tree[string]'
}
Expand Down
22 changes: 18 additions & 4 deletions notebooks/builder_composer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,28 @@
},
{
"cell_type": "code",
"outputs": [],
"outputs": [
{
"data": {
"text/plain": "['__abstractmethods__',\n '__annotations__',\n '__class__',\n '__class_getitem__',\n '__class_vars__',\n '__copy__',\n '__deepcopy__',\n '__delattr__',\n '__dict__',\n '__dir__',\n '__doc__',\n '__eq__',\n '__fields__',\n '__fields_set__',\n '__format__',\n '__ge__',\n '__get_pydantic_core_schema__',\n '__get_pydantic_json_schema__',\n '__getattr__',\n '__getattribute__',\n '__getstate__',\n '__gt__',\n '__hash__',\n '__init__',\n '__init_subclass__',\n '__iter__',\n '__le__',\n '__lt__',\n '__module__',\n '__ne__',\n '__new__',\n '__pretty__',\n '__private_attributes__',\n '__pydantic_complete__',\n '__pydantic_core_schema__',\n '__pydantic_custom_init__',\n '__pydantic_decorators__',\n '__pydantic_extra__',\n '__pydantic_fields_set__',\n '__pydantic_generic_metadata__',\n '__pydantic_init_subclass__',\n '__pydantic_parent_namespace__',\n '__pydantic_post_init__',\n '__pydantic_private__',\n '__pydantic_root_model__',\n '__pydantic_serializer__',\n '__pydantic_validator__',\n '__reduce__',\n '__reduce_ex__',\n '__repr__',\n '__repr_args__',\n '__repr_name__',\n '__repr_str__',\n '__rich_repr__',\n '__setattr__',\n '__setstate__',\n '__signature__',\n '__sizeof__',\n '__slots__',\n '__str__',\n '__subclasshook__',\n '__weakref__',\n '_abc_impl',\n '_calculate_keys',\n '_check_frozen',\n '_copy_and_set_values',\n '_get_value',\n '_iter',\n 'construct',\n 'copy',\n 'dict',\n 'from_orm',\n 'json',\n 'method',\n 'model',\n 'model_computed_fields',\n 'model_config',\n 'model_construct',\n 'model_copy',\n 'model_dump',\n 'model_dump_json',\n 'model_extra',\n 'model_fields',\n 'model_fields_set',\n 'model_json_schema',\n 'model_parametrized_name',\n 'model_post_init',\n 'model_rebuild',\n 'model_validate',\n 'model_validate_json',\n 'model_validate_strings',\n 'parse_file',\n 'parse_obj',\n 'parse_raw',\n 'schema',\n 'schema_json',\n 'serialize_model',\n 'update_forward_refs',\n 'validate']"
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dir()"
"dir(process_config)"
],
"metadata": {
"collapsed": false
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-03-01T18:55:44.251693Z",
"start_time": "2024-03-01T18:55:44.243963Z"
}
},
"id": "a8bc9415d6ac47ad"
"id": "a8bc9415d6ac47ad",
"execution_count": 28
},
{
"cell_type": "code",
Expand Down

0 comments on commit e218542

Please sign in to comment.