Nelly-Barret / BETTER-fairificator

The fairification tools for BETTER project.
https://www.better-health-project.eu/
0 stars 0 forks source link

How to run the code in command-line? #37

Closed Nelly-Barret closed 2 weeks ago

Nelly-Barret commented 2 weeks ago

IntelliJ seems to configure something because I can run the code from there, but not from the command line which complains about unknown modules (imports)...

The one which worked to run the main: .venv-better-fairificator/bin/python src.main --hospital_name=IT_BUZZI_UC1 --database_name=mytestd --metadata_filepath=datasets/metadata/IT-Buzzi-variables.csv --data_filepath=datasets/data/BUZZI/screening.csv --drop=False

Nelly-Barret commented 2 weeks ago

Still, it does not work for test 👹

❯ .venv-better-fairificator/bin/python3.12 test/main.py
Traceback (most recent call last):
  File "/Users/nelly/Documents/boulot/postdoc-polimi/BETTER-fairificator/test/main.py", line 5, in <module>
    from test.testDatabase import TestDatabase
ModuleNotFoundError: No module named 'test.testDatabase'
❯ .venv-better-fairificator/bin/python test.main
/Library/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python: 
can't open file '/Users/nelly/Documents/boulot/postdoc-polimi/BETTER-fairificator/test.main': 
[Errno 2] No such file or directory
Nelly-Barret commented 2 weeks ago

This works in cmd-line: python -m unittest discover (https://stackoverflow.com/a/62748763)

Nelly-Barret commented 2 weeks ago

This has worked. Now the thing is to install MongoDB on the Github pipeline server

https://github.com/Nelly-Barret/BETTER-fairificator/actions/runs/9447947932/job/26020895519

Has shown here: no connection can be made because MongoDb is not installed

Nelly-Barret commented 2 weeks ago

First pipeline to pass: https://github.com/Nelly-Barret/BETTER-fairificator/actions/runs/9448402381/job/26022325387

See also #7