11"""PEtab Problem class"""
22
33import os
4- # Renamed to `Path_` to avoid unknown error during Sphinx doc build
5- from pathlib import Path as Path_
4+ from pathlib import Path
65import tempfile
76from typing import Dict , Iterable , List , Optional , Union
87from warnings import warn
@@ -237,7 +236,7 @@ def from_folder(folder: str, model_name: str = None) -> 'Problem':
237236 )
238237
239238 @staticmethod
240- def from_combine (filename : str ) -> 'Problem' :
239+ def from_combine (filename : Union [ Path , str ] ) -> 'Problem' :
241240 """Read PEtab COMBINE archive (http://co.mbine.org/documents/archive).
242241
243242 See also :py:func:`petab.create_combine_archive`.
@@ -258,7 +257,7 @@ def from_combine(filename: str) -> 'Problem':
258257 "(python-libcombine) must be installed." )
259258
260259 archive = libcombine .CombineArchive ()
261- if archive .initializeFromArchive (filename ) is None :
260+ if archive .initializeFromArchive (str ( filename ) ) is None :
262261 print (f"Invalid Combine Archive: { filename } " )
263262 return None
264263
@@ -273,7 +272,7 @@ def from_combine(filename: str) -> 'Problem':
273272
274273 def to_files_generic (
275274 self ,
276- prefix_path : Union [str , Path_ ],
275+ prefix_path : Union [str , Path ],
277276 ) -> None :
278277 """Save a PEtab problem to generic file names.
279278
@@ -292,7 +291,7 @@ def to_files_generic(
292291 Returns:
293292 The path to the PEtab problem YAML file.
294293 """
295- prefix_path = Path_ (prefix_path )
294+ prefix_path = Path (prefix_path )
296295
297296 # Generate generic filenames for data tables in the PEtab problem that
298297 # contain data.
@@ -326,7 +325,7 @@ def to_files(self,
326325 visualization_file : Optional [str ] = None ,
327326 observable_file : Optional [str ] = None ,
328327 yaml_file : Optional [str ] = None ,
329- prefix_path : Optional [Union [str , Path_ ]] = None ,
328+ prefix_path : Optional [Union [str , Path ]] = None ,
330329 relative_paths : bool = True ,) -> None :
331330 """
332331 Write PEtab tables to files for this problem
@@ -359,9 +358,9 @@ def to_files(self,
359358 If a destination was provided for a non-existing entity.
360359 """
361360 if prefix_path is not None :
362- prefix_path = Path_ (prefix_path )
361+ prefix_path = Path (prefix_path )
363362
364- def add_prefix (path0 : Union [None , str , Path_ ]) -> str :
363+ def add_prefix (path0 : Union [None , str , Path ]) -> str :
365364 if path0 is None :
366365 return path0
367366 return str (prefix_path / path0 )
0 commit comments