@@ -34,11 +34,8 @@ class JAXFluidsFlowEnv(JAXFluidsEnv):
3434 """
3535
3636 def _init_from_hf (self , env_config : dict ) -> None :
37-
3837 # Initialize HF data manager
39- self .hf_repo_id = env_config .get (
40- "hf_repo_id" , "dynamicslab/HydroGym-environments"
41- )
38+ self .hf_repo_id = env_config .get ("hf_repo_id" , "dynamicslab/HydroGym-environments" )
4239 self .local_fallback_dir = env_config .get ("local_fallback_dir" , None )
4340 self .use_clean_cache = env_config .get ("use_clean_cache" , True )
4441
@@ -59,9 +56,7 @@ def _init_from_hf(self, env_config: dict) -> None:
5956 self .env_data_path = self ._setup_environment_data ()
6057
6158 # Resolve and load configuration file
62- self .configuration_file = self ._resolve_configuration_file (
63- env_config .get ("configuration_file" )
64- )
59+ self .configuration_file = self ._resolve_configuration_file (env_config .get ("configuration_file" ))
6560
6661 if not self .configuration_file :
6762 raise ConfigError (
@@ -96,13 +91,9 @@ def _setup_environment_data(self) -> str:
9691 print (f"Using environment data from: { env_path } " )
9792 return env_path
9893 except Exception as e :
99- raise ConfigError (
100- f"Failed to setup environment data for { self .environment_name } : { e } "
101- )
94+ raise ConfigError (f"Failed to setup environment data for { self .environment_name } : { e } " )
10295
103- def _resolve_configuration_file (
104- self , config_file_input : Optional [str ]
105- ) -> Optional [str ]:
96+ def _resolve_configuration_file (self , config_file_input : Optional [str ]) -> Optional [str ]:
10697 """
10798 Resolve configuration file path from various input formats.
10899
@@ -189,9 +180,7 @@ def _find_configuration_file(self) -> Optional[str]:
189180 for pattern in config_patterns :
190181 matches = glob .glob (os .path .join (self .env_data_path , pattern ))
191182 if matches :
192- print (
193- f"Auto-detected configuration file: { os .path .basename (matches [0 ])} "
194- )
183+ print (f"Auto-detected configuration file: { os .path .basename (matches [0 ])} " )
195184 return matches [0 ]
196185
197186 # Not found
@@ -200,4 +189,3 @@ def _find_configuration_file(self) -> Optional[str]:
200189 print (f"Available files: { os .listdir (self .env_data_path )} " )
201190
202191 return None
203-
0 commit comments