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

module 'xentropy.dihedrals' has no attribute 'DihedralEntropy' #74

Open
camattelaer opened this issue Mar 12, 2024 · 3 comments
Open

module 'xentropy.dihedrals' has no attribute 'DihedralEntropy' #74

camattelaer opened this issue Mar 12, 2024 · 3 comments
Assignees

Comments

@camattelaer
Copy link

Hi there,

Followed the conda installation for linux. Everything seems fine, but i based my initial try resulted on the provided examples and it throws this error:

>>> dih_ent = dihedrals.DihedralEntropy(data=data,verbose=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'xentropy.dihedrals' has no attribute 'DihedralEntropy'

I couldn't find any info on how to troubleshoot this.

Kind regards

Charles-Alexandre

@camattelaer
Copy link
Author

Apparently, the attribute to use is dihedralEntropy (note the first lower case).

However i ran into another error which seems problematic:

>>> dih_ent.calculate()
Initializing C++ kernel for kde...
/home/camattelaer/Programs/anaconda3/envs/xEntropy/lib/python3.8/site-packages/xentropy/internal/pre_post_processing.py:59: RuntimeWarning: X-Entropy detected dihedral values that are much larger than pi. Your values are assumed to be in degree. X-Entropy expects dihedrals in radian and will transform the unit of your input. If you do not want this transformation, explicitly specify your input unit with the 'input_unit'-argument
  warnings.warn(warn_msg, RuntimeWarning)
KDE finished.
Traceback (most recent call last):
  File "/home/camattelaer/Programs/anaconda3/envs/xEntropy/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 1565, in squeeze
    squeeze = a.squeeze
AttributeError: 'list' object has no attribute 'squeeze'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/camattelaer/Programs/anaconda3/envs/xEntropy/lib/python3.8/site-packages/xentropy/dihedrals.py", line 128, in calculate
    self.__pdf_x = reshape_arrays_eventually(pdf_xs)
  File "/home/camattelaer/Programs/anaconda3/envs/xEntropy/lib/python3.8/site-packages/xentropy/internal/pre_post_processing.py", line 9, in reshape_arrays_eventually
    out = np.squeeze(some_array)
  File "<__array_function__ internals>", line 200, in squeeze
  File "/home/camattelaer/Programs/anaconda3/envs/xEntropy/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 1567, in squeeze
    return _wrapit(a, 'squeeze', axis=axis)
  File "/home/camattelaer/Programs/anaconda3/envs/xEntropy/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 43, in _wrapit
    result = getattr(asarray(obj), method)(*args, **kwds)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (558,) + inhomogeneous part.

somewhere in the code a list object is created where attribute squeeze is used, but it can't find that attribute...

@Clownshift
Copy link
Collaborator

Hi camattelaer,

Sorry, for the late reply.
Considering your initial post, I think you did not import the module correctly, but I am not sure.
Can you give us a complete code example?

Did you check the tutorial for that module? Maybe that helps.

@Clownshift
Copy link
Collaborator

Considering your second comment. This is definitely a small bug on our side.
Depending on the shape of the data that the users provide, we internally try to reshape the data.
Apparently, you provided data in an unexpected shape.

Can you tell me what data, you provided in which shape? Otherwise, I am not sure, if we need to provide a comprehensive error message for unexpected data shapes, or if there is an actual bug in the reshaping procedure.

Greetings,

@Clownshift Clownshift self-assigned this Jun 5, 2024
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