BohndiekLab / patato

PATATO: A Python PhotoAcoustic Tomography Analysis Toolkit
MIT License
9 stars 4 forks source link

Errors while running tests #41

Closed ASK-DataScience closed 8 months ago

ASK-DataScience commented 8 months ago

I am getting an error after running this step: pip install -e .

image

Also after running this step: python -m unittest

image

This is part of JOSS Review

tomelse commented 8 months ago

The error with editable install is because Python requires the bundled C++ code to be compiled using Microsoft c++ build tools.

My intention for the unittests was to run the tests as follows. That way you don't need the compiler. I haven't worked out a good way of distributing the unittests through pip, so this seemed like the most sensible way to do it, given that most people won't be running unittests (unless you have any other suggestions?).

pip install patato
git clone https://github.com/BohndiekLab/patato
cd patato/tests
python -m unittest
tomelse commented 8 months ago

P.s. I don't really recognise the ImportError that you get in your second screenshot, so please let me know if this doesn't solve the problems :)

tomelse commented 8 months ago

@ASK-DataScience do you think this is an acceptable way to do this?

ASK-DataScience commented 8 months ago

@tomelse I agree with you that most people won't be running unittests, but as a reviewer I should check if it is working correctly for me. Any suggestion on how to make it work? I followed your steps in the documentation.

My next step will be running the examples.

tomelse commented 8 months ago

Did you try the instructions in my previous comment? I.e. installing but not editable (pip install patato), then separately git checkout the repo and run the tests on that code

tomelse commented 8 months ago

Otherwise you'd need to install the Microsoft C++ tools to compile the internal C++ code used for one of the algorithms

ASK-DataScience commented 8 months ago

@tomelse I just tried the instructions in your previous comment (not editable) and I got the following error:

image

ASK-DataScience commented 8 months ago

So looks like the first error is resolved, but we are still stuck with the second one.

tomelse commented 8 months ago

Could you check that your Python environment is set up properly? Maybe try running Python in the command line then run

import patato

Could also check that unittest works for individual test scripts?

python -m unittest test_unmixing.py

I suspect there might be something wrong with the Python environment. It's hard to diagnose from my end though.

ASK-DataScience commented 8 months ago

OK. Tests are finally working for me. But I had to install and run patato on the "base" environment instead of its own environment.

image

ASK-DataScience commented 8 months ago

I suggest you add the option to run patato as not editable on the documentation page as well.

tomelse commented 8 months ago

Thanks, I'll add that to the documentation.