v0.2.0 in fresh conda environment problem #82
Closed
pjgrandinetti
started this conversation in
General
Replies: 1 comment
-
|
The distribution build for Recommended steps for fix: conda create -n temp python=3.10
conda activate temp
pip install mrinversion |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There seem to be issues installing v0.2.0 in a fresh conda environment.
We start with
conda create -n temp python=3.9
conda activate temp
pip install mrinversion
Then we tried to run the notebook from the gallery: plot_2d_4_MgO.SiO2.ipynb
But we got an error that astropy was not available, so we did
pip install astropy
However, immediately following the imports, we encountered the error below.
Any suggestions?
ValidationError Traceback (most recent call last)
Cell In[2], line 5
2 import matplotlib.pyplot as plt
3 import numpy as np
----> 5 from mrinversion.kernel.nmr import ShieldingPALineshape
6 from mrinversion.linear_model import SmoothLasso, TSVDCompression
7 from mrinversion.utils import plot_3d, to_Haeberlen_grid
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/mrinversion/kernel/init.py:2
1 # -- coding: utf-8 --
----> 2 from mrinversion.kernel.relaxation import T1 # NOQA
3 from mrinversion.kernel.relaxation import T2 # NOQA
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/mrinversion/kernel/relaxation.py:5
2 import numpy as np
4 from .utils import _supersampled_coordinates
----> 5 from mrinversion.kernel.base import BaseModel
8 class T2(BaseModel):
9 r"""
10 A class for simulating the kernel of T2 decaying functions,
11
(...)
19 dictionary objects representing the
x-ycoordinate grid.20 """
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/mrinversion/kernel/base.py:6
4 import csdmpy as cp
5 import numpy as np
----> 6 from mrsimulator.methods import BlochDecaySpectrum
8 from .utils import _x_y_to_zeta_eta_distribution
10 dimension_list = (cp.Dimension, cp.LinearDimension, cp.MonotonicDimension)
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/mrsimulator/init.py:39
37 from .spin_system import Coupling # lgtm [py/import-own-module] # noqa:F401
38 from .spin_system import SpinSystem # lgtm [py/import-own-module] # noqa:F401
---> 39 from .simulator import Simulator # lgtm [py/import-own-module] # noqa:F401
40 from .method.spectral_dimension import ( # lgtm [py/import-own-module] # noqa:F401
41 SpectralDimension,
42 )
43 from .method import Method # lgtm [py/import-own-module] # noqa:F401
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/mrsimulator/simulator/init.py:15
13 from mrsimulator import SpinSystem
14 from mrsimulator.base_model import one_d_spectrum
---> 15 from mrsimulator.method import Method
16 from mrsimulator.spin_system.isotope import Isotope
17 from mrsimulator.utils import flatten_dict
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/mrsimulator/method/init.py:21
18 from pydantic import PrivateAttr
19 from pydantic import validator
---> 21 from .event import MixingEvent # noqa: F401
22 from .event import SpectralEvent # noqa: F401
23 from .plot import plot as _plot
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/mrsimulator/method/event.py:172
168 extra = "forbid"
169 validate_assignment = True
--> 172 class ConstantDurationEvent(BaseEvent): # TransitionModulationEvent
173 r"""Base ConstantDurationEvent class defines the spin environment and the
174 transition query for a segment of the transition pathway. The frequency from this
175 event contribute to the spectrum as amplitudes.
(...)
202 from this query will contribute to the net frequency.
203 """
204 duration: float
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/mrsimulator/method/event.py:216, in ConstantDurationEvent()
206 property_unit_types: ClassVar[Dict] = {
207 "duration": "time",
208 **BaseEvent.property_unit_types,
209 }
210 property_default_units: ClassVar[Dict] = {
211 "duration": "µs",
212 **BaseEvent.property_default_units,
213 }
214 property_units: Dict = {
215 "duration": "µs",
--> 216 **BaseEvent().property_default_units,
217 }
219 test_vars: ClassVar[Dict] = {"duration": 0.0}
221 class Config:
File ~/anaconda3/envs/temp/lib/python3.9/site-packages/pydantic/main.py:253, in BaseModel.init(self, **data)
251 #
__tracebackhide__tells pytest and some other tools to omit this function from tracebacks252 tracebackhide = True
--> 253 validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
254 if self is not validated_self:
255 warnings.warn(
256 'A custom validator is returning a value other than
self.\n'257 "Returning anything other than
selffrom a top level model validator isn't supported when validating via__init__.\n"258 'See the
model_validatordocs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.',259 stacklevel=2,
260 )
ValidationError: 1 validation error for BaseEvent
rotor_frequency
Input should be a valid number [type=float_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.11/v/float_type
Beta Was this translation helpful? Give feedback.
All reactions