MDAnalysis / mdaencore

Ensemble overlap comparison software for molecular data.
http://www.mdanalysis.org/mdaencore/
GNU General Public License v2.0
0 stars 0 forks source link

[BUG] ```ClusterCollection``` object has no attribute ```metadata``` #62

Open HeetVekariya opened 8 months ago

HeetVekariya commented 8 months ago

Additional Information

Expected behavior

Actual behavior

[<class 'MDAnalysis.analysis.encore.clustering.ClusterCollection.ClusterCollection'>, <class 'MDAnalysis.analysis.encore.clustering.ClusterCollection.ClusterCollection'>]

Traceback (most recent call last): File "/home/heet/Work/Development/mdanalysis/test.py", line 27, in print([cluster.metadata for cluster in cluster_collection][:2]) File "/home/heet/Work/Development/mdanalysis/test.py", line 27, in print([cluster.metadata for cluster in cluster_collection][:2])

AttributeError: 'ClusterCollection' object has no attribute 'metadata'


## Code to reproduce the behavior ##
- Below code is from **```cluster.py```** ( [here](https://github.com/MDAnalysis/mdanalysis/blob/734314b8b7b70617a92eb505f75844e6837505ca/package/MDAnalysis/analysis/encore/clustering/cluster.py#L147) ).

```python
from MDAnalysis import Universe
import MDAnalysis.analysis.encore as encore
from MDAnalysis.tests.datafiles import PSF, DCD, DCD2
ens1 = Universe(PSF, DCD)
ens2 = Universe(PSF, DCD2)
cluster_collection = encore.cluster([ens1,ens2])

cluster_collection = encore.cluster([ens1,ens2], method=encore.DBSCAN())

cluster_collection = encore.cluster([ens1,ens2], method=[encore.AffinityPropagationNative(preference=-1.), encore.AffinityPropagationNative(preference=-2.)])

print([cluster.metadata for cluster in cluster_collection][:2])

Current version of MDAnalysis

IAlibay commented 8 months ago

Migrating to mdaencore, this is no longer in the realm of the core library.

IAlibay commented 8 months ago

@HeetVekariya to explain the migration - future development of the encore code now happens here, and potentially backported to the core library as necessary.