rs-station / careless

Merge X-ray diffraction data with Wilson's priors, variational inference, and metadata
MIT License
16 stars 6 forks source link

DataSet.reset_index() error #133

Closed gyuhyeokcho closed 1 year ago

gyuhyeokcho commented 1 year ago

Hi, I have encountered the following errors during cchalf, ccpred, and image_ccpred run.

After running normal careless in colab,

!mkdir -p DOF64_test !careless mono \ --studentt-likelihood-dof=64 \ --disable-image-scales \ --merge-half-datasets \ --iterations=30_000 \ --test-fraction 0.05 \ "BATCH,dHKL,Hobs,Kobs,Lobs,XCAL,YCAL,ZCAL,RLP,PEAK,CORR,MAXC,XOBS,YOBS,ZOBS,ALF0,BET0,ALF1,BET1,PSI,ISEG" \ INTEGRATE_xds2mtz.mtz \ DOF64_test/DOF64_test

By running the following command resulted in

!careless.cchalf -m spearman -b 10 -o DOF64_test/DOF64_test_10 DOF64_test/DOF64_test_xval_0.mtz

this message

Traceback (most recent call last): File "/usr/local/bin/careless.cchalf", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/site-packages/careless/stats/cchalf.py", line 147, in main run_analysis(parser) File "/usr/local/lib/python3.10/site-packages/careless/stats/cchalf.py", line 104, in run_analysis result = grouper.apply(ccfunc).reset_index(name='CChalf') File "/usr/local/lib/python3.10/site-packages/pandas/core/series.py", line 1618, in reset_index return df.reset_index( TypeError: DataSet.reset_index() got an unexpected keyword argument 'allow_duplicates'

Similar messages were appeared when I run careless.ccpred and careless.image_ccpred ending with the same TypeError message.

TypeError: DataSet.reset_index() got an unexpected keyword argument 'allow_duplicates'

kmdalton commented 1 year ago

Hi @gyuhyeokcho, thanks for this report. I have not run into this error before. What version of careless are you running? Are you comfortable sharing DOF64_test_xval_0.mtz? It will help me debug your error.

kmdalton commented 1 year ago

Also, can I get your pandas version number? You can get it by running the following:

python -c "import pandas;print(pandas.__version__)"
gyuhyeokcho commented 1 year ago

Dear @kmdalton,

I used careless version 0.3.8 and pandas version 2.0.3. May I have your email to send the mtz file?

FYI. Here is my installation steps for running careless in google colab.

!pip install -q condacolab import condacolab condacolab.install()

!conda create -yn careless python !conda activate careless !pip install --upgrade pip

!pip install tensorflow !python3 -c "import tensorflow as tf; print(len(tf.config.list_physical_devices('GPU')))"

!pip install careless

!python3 -m pip install ipykernel !python3 -m ipykernel install --user

kmdalton commented 1 year ago

Hi @gyuhyeokcho, I was able to reproduce your issue without needing your xval file. This turns out to be an upstream issue relating to reciprocalspaceship and pandas. I'm working with @JBGreisman to resolve the issue. In the meantime, you should be able to fix your careless installation by downgrading pandas using the following command

!pip install pandas==1.4.4

I will leave this issue open until we are able to debug the offending dependencies.

kmdalton commented 1 year ago

Related: https://github.com/rs-station/reciprocalspaceship/issues/223

kmdalton commented 1 year ago

@gyuhyeokcho, this issue should be fixed in v0.3.9. Let me know if you are still having trouble with anything. Thanks again for raising this issue.

gyuhyeokcho commented 1 year ago

@kmdalton, Thank you for the help. I tried with pandas ver. 1.4.4 and the problem was solved!