petermr / pygetpapers

a Python version of getpapers
Apache License 2.0
78 stars 9 forks source link

Cannot run `-u` command #11

Closed petermr closed 3 years ago

petermr commented 3 years ago

I am trying to run the -u command to update a project: The current project tree is:

tree tanzania_clove_seed/
tanzania_clove_seed/
├── PMC7936138
│   ├── eupmc_result.json
│   ├── fulltext.pdf
│   └── fulltext.xml
└── eupmc_results.json

I wish to update it with:

pygetpapers -q "(essential oil) AND tanzania AND clove AND seed" -k 2 -o tanzania_clove_seed -p -x -u

but -u takes an argument.

Updates the corpus by downloading new papers. Takes the path of metadata
                        json file of the orignal corpus as the input. Requires -k or --limit (If not
                        provided, default will be used) and -q or --query (must be provided) to be
                        given. Takes the path to the json as the input.

"the path to the json" is not an acceptable description. There are two *.json files and this must be precise. I assume this means <cproject>/eupmc_results.json but I have tried both:

 pygetpapers -q "(essential oil) AND tanzania AND clove AND seed" -k 2 -o tanzania_clove_seed -p -x -u tanzania_clove_seed/eupmc_results.json 

and

 pygetpapers -q "(essential oil) AND tanzania AND clove AND seed" -k 2 -o tanzania_clove_seed -p -x -u eupmc_results.json 

and both report FileNotFoundError: [Errno 2] No such file or directory: ...

Assuming that that "the json file" is actually tanzania_clove_seed/eupmc_results.json surely we can omit this (or at least default to it?

 pygetpapers -q "(essential oil) AND tanzania AND clove AND seed" -k 2 -o tanzania_clove_seed -p -x -u 

is more natural and safer.

ayush4921 commented 3 years ago

Furthur versions of pygetpapers are very close to this mechanism. Kindly check.