diff --git a/biosimulators_utils/_version.py b/biosimulators_utils/_version.py index e467201a..147d0625 100644 --- a/biosimulators_utils/_version.py +++ b/biosimulators_utils/_version.py @@ -1 +1 @@ -__version__ = '0.1.154' +__version__ = '0.1.155' diff --git a/biosimulators_utils/model_lang/smoldyn/validation.py b/biosimulators_utils/model_lang/smoldyn/validation.py index ef5c7ab9..86c7eea8 100644 --- a/biosimulators_utils/model_lang/smoldyn/validation.py +++ b/biosimulators_utils/model_lang/smoldyn/validation.py @@ -46,7 +46,7 @@ def validate_model(filename, name=None, config=None): if os.path.isfile(filename): config = read_smoldyn_simulation_configuration(filename) disable_smoldyn_graphics_in_simulation_configuration(config) - fid, config_filename = tempfile.mkstemp(suffix='.txt') + fid, config_filename = tempfile.mkstemp(suffix='.txt', dir=os.path.dirname(filename)) os.close(fid) write_smoldyn_simulation_configuration(config, config_filename) with StandardOutputErrorCapturer(level=StandardOutputErrorCapturerLevel.c, relay=False) as captured: diff --git a/biosimulators_utils/omex_meta/io.py b/biosimulators_utils/omex_meta/io.py index 5270dd9f..16458aaa 100644 --- a/biosimulators_utils/omex_meta/io.py +++ b/biosimulators_utils/omex_meta/io.py @@ -202,7 +202,7 @@ def read_rdf(cls, filename, config=None): lines[0] = line - temp_fid, temp_filename = tempfile.mkstemp() + temp_fid, temp_filename = tempfile.mkstemp(dir=os.path.dirname(filename)) os.close(temp_fid) with open(temp_filename, 'wb') as file: for line in lines: diff --git a/biosimulators_utils/sedml/exec.py b/biosimulators_utils/sedml/exec.py index 9501c91f..2e688fc9 100644 --- a/biosimulators_utils/sedml/exec.py +++ b/biosimulators_utils/sedml/exec.py @@ -545,7 +545,7 @@ def exec_task(task, variables, preprocessed_task=None, log=None, config=None, ** model = sub_task.task.model if apply_xml_model_changes and is_model_language_encoded_in_xml(model.language): original_model_source = model.source - fid, model.source = tempfile.mkstemp(suffix='.xml') + fid, model.source = tempfile.mkstemp(suffix='.xml', dir=os.path.dirname(original_model_source)) os.close(fid) model_etrees[model.id].write(model.source, diff --git a/biosimulators_utils/sedml/utils.py b/biosimulators_utils/sedml/utils.py index 515eebbc..b24ab24b 100644 --- a/biosimulators_utils/sedml/utils.py +++ b/biosimulators_utils/sedml/utils.py @@ -299,7 +299,7 @@ def resolve_model_and_apply_xml_changes(model, sed_doc, working_dir, # write model to file if save_to_file: if temp_model_source is None: - modified_model_file, temp_model_source = tempfile.mkstemp(suffix='.xml') + modified_model_file, temp_model_source = tempfile.mkstemp(suffix='.xml', dir=os.path.dirname(model.source)) os.close(modified_model_file) model.source = temp_model_source