amepproject / amep

The Active Matter Evaluation Package (AMEP) - a Python library for the analysis of particle-based and continuum simulation data of soft and active matter systems
https://amepproject.de/
GNU General Public License v3.0
9 stars 2 forks source link

BUG: `evaluate.ClusterGrowth` does not work with fields #9

Closed kai-luca closed 3 months ago

kai-luca commented 3 months ago

Description:

The ClusterGrowth functionality does not work. It just throws an error because it still wants to use an old version of the field cluster detection.

Code for reproduction:

from amep import load
from amep.evaluate import ClusterGrowth
f_traj = load.traj(<Field_trajectory_path>)
ClusterGrowth(

Error message:

Traceback (most recent call last): File "/home/kspanheimer/Documents/dev/amep_project/amep_data/amep_publication_plots/gen_cluster_data.py", line 146, in gen_growth_data(field_trajectories) File "/home/kspanheimer/Documents/dev/amep_project/amep_data/amep_publication_plots/gen_cluster_data.py", line 72, in gen_growth_data wmea_c_grow = np.stack([ClusterGrowth(trajec, ^^^^^^^^^^^^^^^^^^^^^^ File "/home/kspanheimer/Documents/dev/amep_project/amep_data/amep_publication_plots/gen_cluster_data.py", line 72, in wmea_c_grow = np.stack([ClusterGrowth(trajec, ^^^^^^^^^^^^^^^^^^^^^ File "/home/kspanheimer/Documents/dev/amep_project/amep/amep/evaluate.py", line 3538, in init self.frames, self.avg, self.__indices = average_func( ^^^^^^^^^^^^^ File "/home/kspanheimer/Documents/dev/amep_project/amep/amep/utils.py", line 141, in average_func func_result = [func(x, kwargs) for x in tqdm(data[evaluated_indices])] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/kspanheimer/Documents/dev/amep_project/amep/amep/utils.py", line 141, in func_result = [func(x, kwargs) for x in tqdm(data[evaluated_indices])] ^^^^^^^^^^^^^^^^^ File "/home/kspanheimer/Documents/dev/amep_project/amep/amep/evaluate.py", line 3612, in __compute_fields ids, labels = identify_clusters( ^^^^^^^^^^^^^^^^^^ TypeError: identify_clusters() got an unexpected keyword argument 'field'

Python and AMEP versions:

Python 3.11.9 AMEP 1.0.0

Additional information:

I won't add all the reproducabillity etc. since I'll fix it myself.

How did you install AMEP?

pip

kai-luca commented 3 months ago

Erratum: I wasn't acquainted with the changed API signatures. I regret ever posting this.