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

New to Pyrolite and having trouble to make pyroplot .scatter work as per tutorials[FEATURE] #101

Open
mbastosf64 opened this issue Feb 1, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@mbastosf64
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Relevant References
Any references related to the above-mentioned feature or issue.

@mbastosf64 mbastosf64 added the enhancement New feature or request label Feb 1, 2024
@mbastosf64
Copy link
Author

error below
2024-01-31 16:02:27,503 [7796] WARNING py.warnings:109: [JupyterRequire] :228: RuntimeWarning: scipy._lib.messagestream.MessageStream size changed, may indicate binary incompatibility. Expected 56 from C header, got 64 from PyObject


AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_7796/3051707880.py in
5 import pandas as pd
6 import mpltern as mpl
----> 7 from pyrolite.util.synthetic import normal_frame

~\Anaconda3\lib\site-packages\pyrolite\util\synthetic.py in
6
7 from ..comp.codata import ILR, inverse_ILR
----> 8 from ..geochem.ind import REE, get_ionic_radii
9 from ..geochem.norm import get_reference_composition
10 from ..util.lambdas.eval import get_function_components

~\Anaconda3\lib\site-packages\pyrolite\geochem_init_.py in
8 from ..util.log import Handle
9 from ..util.meta import update_docstring_references
---> 10 from . import norm, parse, transform
11 from .ind import REE, REY, _common_elements, _common_oxides
12 from .ions import set_default_ionic_charges

~\Anaconda3\lib\site-packages\pyrolite\geochem\transform.py in
7
8 from ..comp.codata import close, renormalise
----> 9 from ..util import lambdas
10 from ..util.log import Handle
11 from ..util.meta import update_docstring_references

~\Anaconda3\lib\site-packages\pyrolite\util\lambdas_init_.py in
9 from .opt import lambdas_optimize
10 from .params import _get_params, orthogonal_polynomial_constants
---> 11 from .plot import plot_lambdas_components, plot_profiles
12 from .transform import REE_z_to_radii
13

~\Anaconda3\lib\site-packages\pyrolite\util\lambdas\plot.py in
6 import numpy as np
7
----> 8 from ... import plot
9 from ...geochem.ind import REE, get_ionic_radii
10 from ..log import Handle

~\Anaconda3\lib\site-packages\pyrolite\plot_init_.py in
21 from ..util.plot.helpers import plot_cooccurence
22 from ..util.plot.style import _export_nonRCstyles, linekwargs, scatterkwargs
---> 23 from . import density, parallel, spider, stem
24 from .color import process_color
25

~\Anaconda3\lib\site-packages\pyrolite\plot\density_init_.py in
12 from ...util.meta import get_additional_params, subkwargs
13 from ...util.plot.axes import add_colorbar, init_axes
---> 14 from ...util.plot.density import (
15 get_axis_density_methods,
16 percentile_contour_values_from_meshz,

~\Anaconda3\lib\site-packages\pyrolite\util\plot\density.py in
22
23 try:
---> 24 import statsmodels.api as sm
25
26 HAVE_SM = True

~\Anaconda3\lib\site-packages\statsmodels\api.py in
7 from . import tools
8 from .tools.tools import add_constant, categorical
----> 9 from . import regression
10 from .regression.linear_model import OLS, GLS, WLS, GLSAR
11 from .regression.recursive_ls import RecursiveLS

~\Anaconda3\lib\site-packages\statsmodels\regression_init_.py in
----> 1 from .linear_model import yule_walker
2
3 from statsmodels.tools._testing import PytestTester
4
5 all = ['yule_walker', 'test']

~\Anaconda3\lib\site-packages\statsmodels\regression\linear_model.py in
44 from statsmodels.tools.decorators import (cache_readonly,
45 cache_writable)
---> 46 import statsmodels.base.model as base
47 import statsmodels.base.wrapper as wrap
48 from statsmodels.emplike.elregress import _ELRegOpts

~\Anaconda3\lib\site-packages\statsmodels\base\model.py in
14 cached_value, cached_data)
15 import statsmodels.base.wrapper as wrap
---> 16 from statsmodels.tools.numdiff import approx_fprime
17 from statsmodels.tools.sm_exceptions import ValueWarning,
18 HessianInversionWarning

~\Anaconda3\lib\site-packages\statsmodels\tools\numdiff.py in
49
50 # NOTE: we only do double precision internally so far
---> 51 EPS = np.MachAr().eps
52
53 _hessian_docs = """

~\Anaconda3\lib\site-packages\numpy_init_.py in getattr(attr)
360 raise RuntimeError("Tester was removed in NumPy 1.25.")
361
--> 362 raise AttributeError("module {!r} has no attribute "
363 "{!r}".format(name, attr))
364

AttributeError: module 'numpy' has no attribute 'MachAr'

@mbastosf64
Copy link
Author

uisng the latest numpy version, tried to downgrade but still getting this error and the one below , any suggestions.


AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_20640/260713670.py in
----> 1 df[['MgO','Al2O3','CaO']].pyroplot.scatter(color='k', alpha=0.5)

~\Anaconda3\lib\site-packages\pandas\core\generic.py in getattr(self, name)
5573 ):
5574 return self[name]
-> 5575 return object.getattribute(self, name)
5576
5577 def setattr(self, name: str, value) -> None:

AttributeError: 'DataFrame' object has no attribute 'pyroplot

@morganjwilliams
Copy link
Owner

Hey @mbastosf64! Apologies I didn't manage to get back to you last week, the first one I'm unsure about (it does seem to be a statsmodels-numpy version conflict or similar..), but the second one will hopefully be resolved with an added import:

import pyrolite.plot

@mbastosf64
Copy link
Author

mbastosf64 commented Feb 7, 2024 via email

@morganjwilliams
Copy link
Owner

@mbastosf64 it should work with 1.24, if you're still having issues. But it looks like the error relates to a numpy deprecation (since about numpy v1.22), which I think should have been fixed in statsmodels>=0.15.

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

No branches or pull requests

2 participants