Skip to content
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

[BUG] ClusterCollection object has no attribute metadata #62

Open
HeetVekariya opened this issue Jan 5, 2024 · 2 comments
Open

[BUG] ClusterCollection object has no attribute metadata #62

HeetVekariya opened this issue Jan 5, 2024 · 2 comments

Comments

@HeetVekariya
Copy link

Additional Information

  • This issue is originally found in Issue 3925. Please have a look in that conversation.

Expected behavior

  • ClusterCollection object/instance has metadata parameter associated with it. We can check here.
  • Hence metadata of ClusterCollection object/instance should be accessible.

Actual behavior

  • When we try to access metadata of ClusterCollection object/instance then it gives below error
[<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 <module>
    print([cluster.metadata for cluster in cluster_collection][:2])
  File "/home/heet/Work/Development/mdanalysis/test.py", line 27, in <listcomp>
    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 ).
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

  • Which version are you using? (run python -c "import MDAnalysis as mda; print(mda.__version__)")
    • 2.6.1
  • Which version of Python (python -V)?
    • Python 3.10.13
  • Which operating system?
    • Ubuntu
@IAlibay
Copy link
Member

IAlibay commented Jan 5, 2024

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

@IAlibay IAlibay transferred this issue from MDAnalysis/mdanalysis Jan 5, 2024
@IAlibay
Copy link
Member

IAlibay commented Jan 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants