@@ -56,7 +56,7 @@ def hash(self) -> str:
5656 if file .is_file () and file .name .startswith ("experiment_stat" )
5757 ]
5858 # Use hash of experiment_stat as id
59- return file_to_hash (hash_file ) # type: ignore
59+ return file_to_hash (hash_file [ 0 ])
6060
6161 @property
6262 def latest_change (self ) -> float :
@@ -88,14 +88,14 @@ def from_path(cls, path: Path) -> "RayTuneRun":
8888 RayTuneRun
8989 The run.
9090 """
91- configspace = None
91+ configspace_new : dict
9292 hp_names = {}
9393 analysis = None
9494 analysis = ExperimentAnalysis (str (path )).results
9595
9696 # Get the information of the configspace
9797 if not os .path .isfile (str (path ) + "/configspace.json" ):
98- configspace = { # type: ignore
98+ configspace_new = {
9999 "name" : None ,
100100 "hyperparameters" : [],
101101 "conditions" : [],
@@ -115,12 +115,12 @@ def from_path(cls, path: Path) -> "RayTuneRun":
115115 if isinstance (value , str ):
116116 for key , values in hp_names .items ():
117117 values_set = set (values )
118- configspace ["hyperparameters" ].append ( # type: ignore
118+ configspace_new ["hyperparameters" ].append (
119119 {"type" : "categorical" , "name" : key , "choices" : list (values_set )}
120120 )
121121 else :
122122 for key , values in hp_names .items ():
123- configspace ["hyperparameters" ].append ( # type: ignore
123+ configspace_new ["hyperparameters" ].append (
124124 {
125125 "type" : "uniform_" + type (values [0 ]).__name__ ,
126126 "name" : key ,
@@ -130,10 +130,10 @@ def from_path(cls, path: Path) -> "RayTuneRun":
130130 }
131131 )
132132 with open (str (path ) + "/configspace.json" , "w" ) as f :
133- json .dump (configspace , f )
133+ json .dump (configspace_new , f )
134134
135135 # Convert into a Configuration Space object
136- configspace = ConfigurationSpace .from_json (path / "configspace.json" ) # type: ignore
136+ configspace = ConfigurationSpace .from_json (path / "configspace.json" )
137137 file_path = str (path ) + "/experiment_state*"
138138 for filename in glob .glob (file_path ):
139139 with open (filename , "r" ) as f :
@@ -142,7 +142,7 @@ def from_path(cls, path: Path) -> "RayTuneRun":
142142 obj = json .loads (nested_json_str )["trainable_name" ]
143143
144144 objective = Objective (obj )
145- run = RayTuneRun (path .stem , configspace = configspace , objectives = objective ) # type: ignore
145+ run = RayTuneRun (path .stem , configspace = configspace , objectives = objective )
146146
147147 config = None
148148 # Get all information of the run
@@ -184,14 +184,12 @@ def from_path(cls, path: Path) -> "RayTuneRun":
184184 # TODO: Warning also in configspace.json -> Wie?
185185 # TODO: Warning that all get treated as uniform
186186 # TODO: Warning objective bounds & optimize goal
187- # TODO: Store results? Where?
188187 # TODO: Test other functions of
189188 # TODO: Test for mutliple search variants
190189 # TODO: put raytune in doc install
191190 # TODO: Did pyarrow update break anything?
192191 # TODO: ignores rausnehmen
193192 # TODO: adjust git ignore
194- os .remove (path / "configspace.json" )
195193
196194 return run
197195
0 commit comments