-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TropCyclone.from_tracks() takes considerably longer in climada 5.0.0 #988
Comments
Okay so, profiling the function shows that 84% of the time is spent at line 375 of tropical_cyclone.py: Note: The profile results are run only with: tracks_SI_proba = TCTracks.from_ibtracs_netcdf(year_range=(1990, 2023), basin='SI') with out the following code, as it takes 1h per run... I will run the profiling for the slow version as well. But I would assume, maybe wrongly, that the behaviour will be the same. tracks_SI_proba.equal_timestep(time_step_h=1)
tracks_SI_proba.calc_perturbed_trajectories(nb_synth_tracks=9, max_shift_ini=0.75, max_dspeed_rel=0.3) @emanuel-schmid I can send you the profiling data per slack, github do not support the |
Update: One step further (without perturbed trajectoires), in
def append(self, centr):
"""Append Centroids
Note that the result might contain duplicate points if the object to append has an overlap
with the current object.
Parameters
----------
centr : Centroids
Centroids to append. The centroids need to have the same CRS.
Raises
------
ValueError
See Also
--------
union : Union of Centroid objects.
remove_duplicate_points : Remove duplicate points in a Centroids object.
"""
if not u_coord.equal_crs(self.crs, centr.crs):
raise ValueError(
f"The given centroids use different CRS: {self.crs}, {centr.crs}. "
"The centroids are incompatible and cannot be concatenated."
)
self.gdf = pd.concat([self.gdf, centr.gdf]) |
I think I found a potential solution, I'll make a PR 🙃 |
TropCyclone.from_tracks() takes orders of magnitude longer in climada 5.0.0 compared to 3.3.0 (all else being equal in terms of numbers of tracks, centroid resolution etc.)
Code example:
Screenshots
If applicable, add screenshots to help explain your problem.
Climada Version: 5.0.0
System Information (please complete the following information):
Run on IAC hub
The text was updated successfully, but these errors were encountered: