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

Changed log level of Capturer Object #67

Merged
merged 3 commits into from
May 8, 2023
Merged
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
18 changes: 15 additions & 3 deletions biosimulators_copasi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@
import numpy
import os
import tempfile
import platform


__all__ = ['exec_sedml_docs_in_combine_archive', 'exec_sed_doc', 'exec_sed_task', 'preprocess_sed_task']


CURRENT_PLATFORM = platform.system()
try:
assert CURRENT_PLATFORM == "Darwin"
DEFAULT_STDOUT_LEVEL = StandardOutputErrorCapturerLevel.python
except AssertionError as e:
DEFAULT_STDOUT_LEVEL = StandardOutputErrorCapturerLevel.c


def exec_sedml_docs_in_combine_archive(archive_filename: str, out_dir: str, config: Optional[Config] = None,
fix_copasi_generated_combine_archive: Optional[bool] = None) -> Tuple[SedDocumentResults, CombineArchiveLog]:
""" Execute the SED tasks defined in a COMBINE/OMEX archive and save the outputs
Expand Down Expand Up @@ -79,7 +89,7 @@ def exec_sedml_docs_in_combine_archive(archive_filename: str, out_dir: str, conf
def exec_sed_doc(doc: Union[SedDocument, str], working_dir: str, base_out_path: str, rel_out_path: Optional[str] = None,
apply_xml_model_changes: bool = True, log: Optional[SedDocumentLog] = None,
indent: int = 0, pretty_print_modified_xml_models: bool = False,
log_level: Optional[Union[StandardOutputErrorCapturerLevel, str]] = StandardOutputErrorCapturerLevel.c,
log_level: Optional[StandardOutputErrorCapturerLevel]=DEFAULT_STDOUT_LEVEL,
config: Optional[Config] = None) -> Tuple[ReportResults, SedDocumentLog]:
""" Execute the tasks specified in a SED document and generate the specified outputs

Expand Down Expand Up @@ -190,8 +200,10 @@ def exec_sed_task(task: Task, variables: List[Variable], preprocessed_task: Opti
else: # noqa python:S3776
step_number = (
sim.number_of_points
* (sim.output_end_time - sim.initial_time)
/ (sim.output_end_time - sim.output_start_time)
* (
(sim.output_end_time - sim.initial_time)
/ (sim.output_end_time - sim.output_start_time)
)
)
if step_number != math.floor(step_number):
raise NotImplementedError('Time course must specify an integer number of time points')
Expand Down