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

acor module error #5

Closed
cmarsan opened this issue Jan 20, 2017 · 7 comments
Closed

acor module error #5

cmarsan opened this issue Jan 20, 2017 · 7 comments

Comments

@cmarsan
Copy link

cmarsan commented Jan 20, 2017

Hi, I'm pretty new to python and am having an issue with acor that I thought I installed successfully (tried both pip install and git clone). I'm getting pretty similar errors as those listed in issue #4, and I need acor for a separate Python algorithm. I have Python 3.5.2 through Anaconda.

import acor
acor
<module 'acor' from '/localdir/anaconda3/lib/python3.5/site-packages/acor/init.py'>
import numpy as np
a= np.random.rand(500)
acor(a)
Traceback (most recent call last):
File "", line 1, in
TypeError: 'module' object is not callable

Any tips?

@dfm
Copy link
Owner

dfm commented Jan 20, 2017

Have you tried calling the acor function instead of the module? The usage is given here: https://github.com/dfm/acor#usage

@dfm
Copy link
Owner

dfm commented Jan 20, 2017

Also: I'd recommend checking out the autocorr module in emcee http://dan.iel.fm/emcee/current/api/#autocorrelation-analysis because it's a bit more reliable. acor will be marginally faster but it will probably only be worth it if you need to compute many autocorrelation times on datasets with billions of points.

@cmarsan
Copy link
Author

cmarsan commented Jan 20, 2017

If I call the acor function, I get:
AttributeError: module 'acor' has no attribute 'acor'

@dfm
Copy link
Owner

dfm commented Jan 20, 2017

Sounds like it didn't get installed then. How did you install the package?

@cmarsan
Copy link
Author

cmarsan commented Jan 20, 2017

pip install acor

@dfm
Copy link
Owner

dfm commented Jan 20, 2017

I dunno then. Try cloning from github and installing that way. No one has touched this project in 3 years so it's definitely use at your own risk! I'd still recommend the algorithm in emcee before this one.

@dfm dfm closed this as completed Jan 20, 2017
@FrederikHeber
Copy link

FrederikHeber commented Dec 20, 2018

This is the same issue as #4. My workaround (for python3.5 and newer) is to replace in acor/acor.py

import _acor

by

import acor._acor as _acor

Then the acor function can be used after importing as import acor.acor as acor.

Seems the pip package installed by

pip3 install acor

(states to be acor-1.1.1) is out-dated, the Github code is more recent and fixes this?

golamshaifullah added a commit to golamshaifullah/acor that referenced this issue May 11, 2022
Changed : from . import _acor
To : import acor._acor as _acor
Solution originally posted by @FrederikHeber in dfm#5 (comment)
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

3 participants