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

Refactor core logic out of user scripts and into package-level modules #12

Open
spencerahill opened this issue Jun 29, 2020 · 0 comments

Comments

@spencerahill
Copy link
Member

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.

@spencerahill 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant