juliema / label_reconciliations

Code for reconciling multiple transcriptions for a label
MIT License
26 stars 11 forks source link

error when running reconciliations #52

Closed juliema closed 6 years ago

juliema commented 6 years ago

so after I ran git pull I tried a reconciliation and got the following error. I will send the dataset over email.

Traceback (most recent call last): File "reconcile.py", line 287, in main() File "reconcile.py", line 249, in main unreconciled, column_types = formats[args.format].read(args) File "/Users/Jules/Dropbox/1-Projects/Notes_From_Nature/1-NfN_Data_forProviders/label_reconciliations/lib/formats/nfn.py", line 49, in read df = (df.reindex(columns, axis=1) File "/Users/Jules/Dropbox/1-Projects/Notes_From_Nature/1-NfN_Data_forProviders/label_reconciliations/venv/lib/python3.5/site-packages/pandas/core/frame.py", line 2733, in reindex **kwargs) File "/Users/Jules/Dropbox/1-Projects/Notes_From_Nature/1-NfN_Data_forProviders/label_reconciliations/venv/lib/python3.5/site-packages/pandas/core/generic.py", line 2494, in reindex 'argument "{0}"'.format(list(kwargs.keys())[0])) TypeError: reindex() got an unexpected keyword argument "axis"

CapPow commented 6 years ago

Juliema, I think this is a pandas version issue. Sorry for the haddle, it looks like sometime after 0.20 they added the axis keyword argument. Using the python interpreter, you can check your version with:

import pandas as pd
pd.__version__

This may be a question of preference: you could expect the users to use recent Pandas, Check the users' version and adjust the line, or maybe catch the exception and adjust the line?

rafelafrance commented 6 years ago

We use a virtual environment. It should be the version from requirements.txt. if you want me to upgrade, put in an issue.

On Mon, Jun 25, 2018, 11:15 AM Caleb Powell notifications@github.com wrote:

Juliema, I think this is a pandas version issue. Sorry for the haddle, it looks like sometime after 0.20 https://pandas.pydata.org/pandas-docs/version/0.20/generated/pandas.DataFrame.reindex.html they added the axis keyword argument https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.reindex.html. Using the python interpreter, you can check your version with:

import pandas as pd pd.version

This may be a question of preference: you could expect the users to use recent Pandas, Check the users' version and adjust the line, or maybe catch the exception and adjust the line?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/juliema/label_reconciliations/issues/52#issuecomment-399988187, or mute the thread https://github.com/notifications/unsubscribe-auth/ALWdwIiBrKN_UXALmhqo0QxJIh4uSXS5ks5uAP6ngaJpZM4U08ze .

PmasonFF commented 6 years ago

And if we are going to upgrade the environment let's use the latest versions? I had a &*(^%% of a time to get this current version of reconcile.py to run and just as soon not have to do this often.

Unfortunately I have destroyed the original environment to get this to run so am between a rock and hard place if we decide to go back.....

rafelafrance commented 6 years ago

I cleaned out requirements.txt and updated the required modules to their latest version. This means that if you are running things off of the master branch you should remove your current ./venv directory and rerun the virtual environment setup step. Something similar to this:

Either:mv ./venv ./venv_old or rm -r ./venv

Then

virtualenv venv -p python3
source venv/bin/activate
pip install -r requirements.txt