Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load_ndcs module as separate runnable module #15

Open
yevgenybulochnik opened this issue May 12, 2020 · 5 comments
Open

Load_ndcs module as separate runnable module #15

yevgenybulochnik opened this issue May 12, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@yevgenybulochnik
Copy link
Member

We should consider making the load_ndcs module separately runnable from the web server itself. This would avoid the current process of commenting out part of the run.py module.

@finish06
Copy link
Member

An approach to doing this is separate folder / code structure for the load_ndcs & connect_db modules. Create a folder, e.g. ./build_data and place the files in the such folder. Then enable the load_ndcs module to run via command line and make a change to docker-compose so it is a separate container. I think if we intend to decouple the code, we need to make the folder structure foretelling. Thoughts?

@yevgenybulochnik
Copy link
Member Author

makes sense, if we go the container route for loading data we likely need another docker-compose. maybe docker-compose.build-data.yml. This way we can specify (docker-compose up -f docker-compose.build.yml) when the data should be built. Otherwise on every docker-compose up it will run through the data. Another approach would be to build in some sort of check to see if the data has already been loaded.

@yevgenybulochnik
Copy link
Member Author

yevgenybulochnik commented May 12, 2020

Since we would be changing the dir structure of the project what dir and names make most sense?

build_data/
server/
database/
build_data/
server/
connect_db.py

or we could keep connect_db.py and just make a models specific dir

build_data/
server/
models/
connect_db.py

just thoughts, I always find structure and naming to be tricky not sure what is best @hl1 any thoughts on this

@finish06
Copy link
Member

finish06 commented May 12, 2020

connect_db.py is only used by load_ndcs.py therefore I think it can stay in the same directory as load_ndcs.py. That may change in the future, but we can make changes when that happens. I prefer the following:

build_data/
server/
models/

@finish06
Copy link
Member

I am struggling to import the helper function from the parent directory. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants