materialsproject / pyrho

https://materialsproject.github.io/pyrho/
Other
37 stars 7 forks source link

Import fails in pyrho.parameters import (requires collections.OrderedDict) #107

Closed jake-vikoren closed 1 year ago

jake-vikoren commented 1 year ago

I am unable to import the package. Below is the trace back and error that I am receiving.

Cell In[4], line 7 4 from pymatgen.core import Structure 5 from pymatgen.io.vasp import Chgcar ----> 7 import pyrho 9 import matplotlib.pyplot as plt 10 import seaborn as sns

File ~/****/site-packages/pyrho/init.py:37 34 import numpy as np 36 # Place all submodule functions and variables into namespace ---> 37 from pyrho.parameters import 38 from pyrho.utilities import 39 from pyrho.loadData import #import loadData

File ~/**/site-packages/pyrho/parameters.py:534 529 #squarePulses = ['custom', 'delta', 'step', 'rectifier', 'shortPulse', 'recovery'] #{'custom': True, 'delta': True, 'step': True, 'rectifier': True, 'shortPulse': True, 'recovery': True} 530 #arbitraryPulses = ['custom', 'sinusoid', 'chirp', 'ramp'] #{'custom': True, 'sinusoid': True, 'chirp': True, 'ramp':True} # Move custom here 532 smallSignalAnalysis = ['delta', 'step', 'sinusoid'] --> 534 protParams['custom'].add_many(('phis', [1e16,1e17], 0, None, molemm-2*second-1, '\mathbf{\phi}', 'List of flux values'), #'photons/s/mm^2' 535 ('Vs', [-70,-20,10], None, None, mV, '\mathbf{\mathrm{V}}', 'List of voltage clamp values (if applied)'), #'mV' 536 ('delD', 25, 0, 1e9, ms, '\Delta t_{delay}', 'Delay duration before the first pulse'), #'ms' 537 ('cycles', [[150.,50.]], 0, None, ms, 'cycles', 'List of [on, off] durations for each pulse'))#, #'ms'#, 539 protParams['step'].add_many(('phis', [1e16,1e17], 0, None, mole*mm*-2second-1, '\mathbf{\phi}', 'List of flux values'), #'photons/s/mm^2' ... 236 raise ValueError("'%s' is not a Parameter" % par) --> 237 OrderedDict.setitem(self, key, par) 238 par.name = key

TypeError: descriptor 'setitem' requires a 'collections.OrderedDict' object but received a 'PyRhOparameters'

jmmshn commented 1 year ago

The package is here and should be installed with pip install mp-pyrho

https://pypi.org/project/mp-pyrho/

Sorry for the confusion.

jake-vikoren commented 1 year ago

Ah, thank you for the clarification! Installing with "pip install mp-pyrho" instead of "pip install pyrho" resolved my error. Cheers!