File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -177,9 +177,8 @@ def _get_content(self) -> list[str]:
177177 def __repr__ (self ):
178178 return f"PlanetConfig(name={ self .name } , planets={ list (self .planets .keys ())} )"
179179
180- def get_max_distance (self ) -> None :
181- distances = [planet .distance for planet in self .planets .values ()]
182- return np .max (distances ) * self ._unit_system .length
180+ def get_distances (self ) -> np .ndarray :
181+ return np .array ([planet .distance for planet in self .planets .values ()])
183182
184183 @classmethod
185184 def get_configs (cls ) -> list ["PlanetConfig" ]:
Original file line number Diff line number Diff line change @@ -262,11 +262,15 @@ def simulate(
262262 ## Mesh Parameters
263263 mesh_parameters = samples ["mesh_parameters" ]
264264
265+ distances = self ._planet_config .get_distances ()
266+
265267 param_config ["mesh_parameters.ymin" ] = (
266- (mesh_parameters ["y_min" ] * un .AU ).to (self ._unit_system .length ).value
268+ (np .min ([mesh_parameters ["y_min" ], distances .min ()]) * un .AU )
269+ .to (self ._unit_system .length )
270+ .value
267271 )
268272
269- max_orbit_radius = self . _planet_config . get_max_distance ()
273+ max_orbit_radius = distances . max ()
270274 param_config ["mesh_parameters.ymax" ] = (
271275 mesh_parameters ["y_max_ratio" ]
272276 * max_orbit_radius .to (self ._unit_system .length ).value
You can’t perform that action at this time.
0 commit comments