You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moving forward, we should think of digipyro as a Python package rather than just a collection of scripts. That means the top-level directory contains setup.py, a doc directory for documentation, the license and README, and the digipyro directory in which the meat and potatoes of the actual package code goes. (When you clone the repo to your own computer, the top-level directory will also be named digipyro unless you rename it, so that the README is at digipyro/README.md, the main package code directory is digipyro/digipyro, etc.) The scripts go within the main code directory in a scripts subdirectory, i.e. in `digipyro/digipyro/scripts'.
We will have a digipyro/digipyro/__init__.py script, which makes the python interpreter formally recognize that directory as defining a package. See https://docs.python.org/3/tutorial/modules.html#packages. That file should mostly just consist of relative imports from the other modules in that directory.
All of the core logic that is currently used by the digipyro.py and synth.py scripts should be refactored into modules. Both scripts can then import whatever they need from the digipyro package.
The text was updated successfully, but these errors were encountered:
spencerahill
changed the title
Refactor core logic out of user scripts and into package-level modules.
Refactor core logic out of user scripts and into package-level modules
Jun 29, 2020
Moving forward, we should think of digipyro as a Python package rather than just a collection of scripts. That means the top-level directory contains
setup.py
, adoc
directory for documentation, the license and README, and thedigipyro
directory in which the meat and potatoes of the actual package code goes. (When you clone the repo to your own computer, the top-level directory will also be named digipyro unless you rename it, so that the README is atdigipyro/README.md
, the main package code directory isdigipyro/digipyro
, etc.) The scripts go within the main code directory in ascripts
subdirectory, i.e. in `digipyro/digipyro/scripts'.We will have a
digipyro/digipyro/__init__.py
script, which makes the python interpreter formally recognize that directory as defining a package. See https://docs.python.org/3/tutorial/modules.html#packages. That file should mostly just consist of relative imports from the other modules in that directory.All of the core logic that is currently used by the
digipyro.py
andsynth.py
scripts should be refactored into modules. Both scripts can then import whatever they need from thedigipyro
package.The text was updated successfully, but these errors were encountered: