petermr / pygetpapers

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

`--restart` fails #27

Closed ShweataNHegde closed 3 years ago

ShweataNHegde commented 3 years ago

Describe the bug From what I understand, --restart works just like how --updatenow works. We would have to specify the output directory (already existing Cproject) and give it --restart. But the error says that --restart flag requires an argument.

To Reproduce INPUT:

C:\Users\shweata>pygetpapers -q "invasive plant species" -o lantana_test_5 --restart -c

OUTPUT:

usage: pygetpapers [-h] [--config CONFIG] [-v] [-q QUERY] [-o OUTPUT] [--save_query] [-x] [-p] [-s] [-z] [--references REFERENCES] [-n] [--citations CITATIONS]
                   [-l LOGLEVEL] [-f LOGFILE] [-k LIMIT] [-r RESTART] [-u] [--onlyquery] [-c] [--makehtml] [--synonym] [--startdate STARTDATE] [--enddate ENDDATE]
                   [--terms TERMS] [--api API] [--filter FILTER]
pygetpapers: error: argument -r/--restart: expected one argument
petermr commented 3 years ago

I think we need to outline what we want these functions to do. And what information the CProject holds. It should maintain state as much as possible e.g.

pygetpapers -o ebola -q ebola -k 1000 -x should remember:

I can think of:

I think we need a Wikipage about this.

On Fri, Aug 6, 2021 at 6:01 PM ShweataNHegde @.***> wrote:

Describe the bug From what I understand, --restart works just like how --update now works. We would have to specify the output directory (already existing Cproject) and give it --restart. But the error says that --restart` flag requires an argument.

To Reproduce INPUT:

C:\Users\shweata>pygetpapers -q "invasive plant species" -o lantana_test_5 --restart -c

OUTPUT:

usage: pygetpapers [-h] [--config CONFIG] [-v] [-q QUERY] [-o OUTPUT] [--save_query] [-x] [-p] [-s] [-z] [--references REFERENCES] [-n] [--citations CITATIONS] [-l LOGLEVEL] [-f LOGFILE] [-k LIMIT] [-r RESTART] [-u] [--onlyquery] [-c] [--makehtml] [--synonym] [--startdate STARTDATE] [--enddate ENDDATE] [--terms TERMS] [--api API] [--filter FILTER] pygetpapers: error: argument -r/--restart: expected one argument

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/petermr/pygetpapers/issues/27, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFTCS4NJXP6PLGW7ZKAWGLT3QIONANCNFSM5BWIRIUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

-- Peter Murray-Rust Founder ContentMine.org and Reader Emeritus in Molecular Informatics Dept. Of Chemistry, University of Cambridge, CB2 1EW, UK

ShweataNHegde commented 3 years ago

@ayush4921,

I'm now running on version:

 C:\Users\shweata>pygetpapers -v
INFO: You are running pygetpapers version 0.0.8.7

I tried reproducing the same query as earlier, here's the error I get:

C:\Users\shweata>pygetpapers -q "invasive plant species" -o lantana_test_5 --restart -c
Traceback (most recent call last):
  File "c:\users\shweata\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\shweata\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\shweata\AppData\Local\Programs\Python\Python38\Scripts\pygetpapers.exe\__main__.py", line 7, in <module>
  File "c:\users\shweata\appdata\local\programs\python\python38\lib\site-packages\pygetpapers\pygetpapers.py", line 604, in main
    callpygetpapers.handlecli()
  File "c:\users\shweata\appdata\local\programs\python\python38\lib\site-packages\pygetpapers\pygetpapers.py", line 568, in handlecli
    self.handle_restart(args)
  File "c:\users\shweata\appdata\local\programs\python\python38\lib\site-packages\pygetpapers\pygetpapers.py", line 235, in handle_restart
    self.europe_pmc.eupmc_restart(args, restart_file_path)
TypeError: eupmc_restart() takes 2 positional arguments but 3 were given

What am I getting wrong?

ayush4921 commented 3 years ago

This issue has been fixed