pyronear / pyro-platform

Detection & monitoring platform of wildfires
https://platform.pyronear.org/
Apache License 2.0
10 stars 11 forks source link

Reorganize projects to be able to test functions #87

Open frgfm opened 2 years ago

frgfm commented 2 years ago

As discussed in #85, most of the platform features are not tested yet. In order to solve this, we should move all non-frontend operations to a python folder for testing purposes.

Basically splitting the project into backend & frontend:

pechouc commented 2 years ago

Thanks for the idea, it would indeed be great to test more systematically the logic in this repository! I wanted to discuss this in an issue before implementation to make sure I understand how to organise this.

Should the "python folder" that you mention look like the services sub-folder? We would have an __init__.py file in it, as well as another Python script storing the functions. Then, this sort of local package would be imported in main.py or in the other files. Is this correct?

Sorry for the maybe simple questions, but I probably lack some basic notions and I still need this kind of clarifications 😊

frgfm commented 2 years ago

More or so, yes ! I think we could have something like this in the source folder:

(of course the naming of folders can be changed)

Akilditu commented 2 years ago

I understand the need of testing and reshaping the project-tree to do so.

But splitting back and front isn't that easy as dash mix both (as you said @frgfm the actual main.py gathers py function that triggers dash objects for frontends purposes.

So the solution would be to create a brand new test folder with a test flask app + a new test.py that maps actual main.py core python functions and API interactions (without dash basically) ?

frgfm commented 2 years ago

Oh so you don't think there are functions we could disentangle from dash main.py ? I thought we could, but if that's not possible, I might have been wrong with this suggestion :sweat_smile: