yannickoswald / covpol

COVPOL: An agent-based model of the international COVID-19 policy response
3 stars 1 forks source link

Change `./code/` to `./src/` #16

Closed ksuchak1990 closed 1 year ago

ksuchak1990 commented 1 year ago

When I try to run the jupyter notebook with the update environment, I'm getting some errors that mean that the notebook cannot connect to the kernel. This looks like it arises from the python scripts being in a directory called code which apparently causes some conflicts somewhere. I've tried changing the directory name on my machine and the notebook can now connect to the kernel.

Can we change the name of this directory to something like src?

yannickoswald commented 1 year ago

hmm oh never had that ever. but okay, i think with the relative paths now that should not be an issue, should it?

ksuchak1990 commented 1 year ago

Exactly!

I would generally default to having my scripts in a directory called src/, but you could also give it a different a name (I think technically this is supposed to be good practice - https://docs.python-guide.org/writing/structure/).

yannickoswald commented 1 year ago

Exactly!

I would generally default to having my scripts in a directory called src/, but you could also give it a different a name (I think technically this is supposed to be good practice - https://docs.python-guide.org/writing/structure/).

okay. I did not know that either :)

nickmalleson commented 1 year ago

+1 for giving the directory a package-like name. This may be one of the reason I was having problems with importing libraries things in the tests (https://github.com/eeyouol/Covid_policy_response_abm/pull/14)

How about covid or covpol?

yannickoswald commented 1 year ago

+1 for giving the directory a package-like name. This may be one of the reason I was having problems with importing libraries things in the tests (#14)

How about covid or covpol?

do you refer the whole repository or just the folder with the code? I think src for scripts makes sense? But happy to name the whole repository covpol?

ksuchak1990 commented 1 year ago

+1 for giving the directory a package-like name. This may be one of the reason I was having problems with importing libraries things in the tests (https://github.com/eeyouol/Covid_policy_response_abm/pull/14)

How about covid or covpol?

My vote would be for covpol of those two.

nickmalleson commented 1 year ago

+1 for giving the directory a package-like name. This may be one of the reason I was having problems with importing libraries things in the tests (#14) How about covid or covpol?

do you refer the whole repository or just the folder with the code? I think src for scripts makes sense? But happy to name the whole repository covpol?

Just the folder with the code. Then the code becomes a 'package'. The advantage to this is that you can import it from elsewhere (like in the tests) with:

from covpol.agent_classs import CountryAgent

rather than

from src.agent_classs import CountryAgent
yannickoswald commented 1 year ago

done