2525# --- from function -------------------------------------------------------------------------------
2626
2727
28- def from_Solis (filepath , name = None , parent = None , verbose = True ) -> Data :
28+ def from_Solis (fpath , name = None , parent = None , verbose = True ) -> Data :
2929 """Create a data object from Andor Solis software (ascii exports).
3030
3131 Parameters
3232 ----------
33- filepath : path-like
33+ fpath : path-like
3434 Path to file (should be .asc format).
3535 Can be either a local or remote file (http/ftp).
3636 Can be compressed with gz/bz2, decompression based on file name.
@@ -60,8 +60,7 @@ def from_Solis(filepath, name=None, parent=None, verbose=True) -> Data:
6060
6161 """
6262 # parse filepath
63- filestr = os .fspath (filepath )
64- filepath = pathlib .Path (filepath )
63+ filepath = pathlib .Path (fpath )
6564
6665 if not ".asc" in filepath .suffixes :
6766 wt_exceptions .WrongFileTypeWarning .warn (filepath , ".asc" )
@@ -70,7 +69,7 @@ def from_Solis(filepath, name=None, parent=None, verbose=True) -> Data:
7069 name = filepath .name .split ("." )[0 ]
7170 # create data
7271 ds = DataSource (None )
73- f = ds .open (filestr , "rt" )
72+ f = ds .open (str ( filepath ) , "rt" )
7473 axis0 = []
7574 arr = []
7675 attrs = {}
@@ -127,7 +126,7 @@ def get_frames(f, arr, axis0):
127126 f"{ filepath .name } has no 'Date and Time' field: using file modified time instead: { created } "
128127 )
129128
130- kwargs = {"name" : name , "kind" : "Solis" , "source" : filestr , "created" : created }
129+ kwargs = {"name" : name , "kind" : "Solis" , "source" : str ( filepath ) , "created" : created }
131130 if parent is None :
132131 data = Data (** kwargs )
133132 else :
0 commit comments