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

error: "NameError: name 'staticmethodzoom' is not defined" #51

Closed
nitin0301 opened this issue Feb 20, 2019 · 7 comments
Closed

error: "NameError: name 'staticmethodzoom' is not defined" #51

nitin0301 opened this issue Feb 20, 2019 · 7 comments

Comments

@nitin0301
Copy link

I am using the Anaconda environment and the Ipython notebook.

When using:
from matminer.featurizers.composition import ElementProperty

I get following error:


NameError Traceback (most recent call last)
in
----> 1 from matminer.featurizers.composition import ElementProperty

~/anaconda/envs/py3/lib/python3.6/site-packages/matminer/featurizers/composition.py in
16
17 from matminer.featurizers.base import BaseFeaturizer
---> 18 from matminer.featurizers.utils.stats import PropertyStats
19 from matminer.utils.data import DemlData, MagpieData, PymatgenData,
20 CohesiveEnergyData, MixingEnthalpy, MatscholarElementData

~/anaconda/envs/py3/lib/python3.6/site-packages/matminer/featurizers/utils/stats.py in
13
14
---> 15 class PropertyStats(object):
16 """This class contains statistical operations that are commonly employed
17 when computing features.

~/anaconda/envs/py3/lib/python3.6/site-packages/matminer/featurizers/utils/stats.py in PropertyStats()
337 return np.array(data_lst).flatten()
338
--> 339 @staticmethodzoom
340 def quantile(data_lst, weights=None, q=0.5):
341 """

NameError: name 'staticmethodzoom' is not defined

@ardunn
Copy link
Contributor

ardunn commented Feb 20, 2019

Hi @nitin0301,

Which version of matminer are you using (do conda list)? On the current master branch I do not see this issue (I am guessing it is just a typo):

@staticmethod
    def quantile(data_lst, weights=None, q=0.5):
        """
        Return a specific quantile.
        Args:
            data_lst (list or np.ndarray): 1D data list to be used for computing
                quantiles
            q (float): The quantile, as a fraction between 0 and 1.
        Returns:
            (float) The computed quantile of the data_lst.
        """
        q = float(q)
        return np.quantile(data_lst, q=q)

The first thing I would recommend is upgrading your matminer to the newest version.

@nitin0301
Copy link
Author

I think it is the current version:

matminer 0.5.2 pypi_0 pypi

@computron
Copy link
Contributor

Look like somehow the word "zoom" got added in your source code. Please make sure you didn't add it unintentionally. Anyway, you can probably just delete the "zoom" part like in @ardunn 's code example

@ardunn
Copy link
Contributor

ardunn commented Feb 20, 2019

@computron it is in the matminer 0.5.2(?) release: https://pypi.org/project/matminer/#files

Seems like the only release it is in?

@computron
Copy link
Contributor

Yes it looks like that release has some issues, let me try a new one now

@computron
Copy link
Contributor

@nitin0301 - thanks for reporting
@ardunn - thanks for checking this

I just pushed matminer v0.5.3 which should fix this.

@nitin0301
Copy link
Author

Thanks @computron. Everything working after removing zoom.

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