Skip to content

Commit

Permalink
Removing some trailing whitespaces etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWilhelm committed Jul 3, 2019
1 parent 7e35f54 commit 5c584c1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
Changelog
=========

Version 0.2
===========

- Reworked the general layout some more

Version 0.1
===========

- Feature A added
- FIX: nasty bug #1729 fixed
- add your changes here!
- Initial commit
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# pyscaffoldext-dsproject

[PyScaffold] extension tailored for *Data Science* projects. This extension is inspired by
[cookiecutter-data-science] and enhanced in many ways. The main differences are that it:
[cookiecutter-data-science] and enhanced in many ways. The main differences are that it
1. advocates a proper Python package structure that can be shipped and distributed,
2. uses a [conda] environment instead of something `virtualenv` based and is thus more suitable
for data science projects.
3. has tons more default configuration for [Sphinx], [py.test], [pre-commit], etc. to foster
for data science projects,
3. more default configurations for [Sphinx], [py.test], [pre-commit], etc. to foster
clean coding and best practices.

The final directory structure looks like:
Expand All @@ -18,43 +18,43 @@ The final directory structure looks like:
├── CHANGELOG.rst <- Changelog to keep track of new features and fixes between versions.
├── LICENSE.txt <- License as chosen as specified on the command-line.
├── README.md <- The top-level README for developers using this project.
├── data
├── data
│ ├── external <- Data from third party sources.
│ ├── interim <- Intermediate data that has been transformed.
│ ├── processed <- The final, canonical data sets for modeling.
│ └── raw <- The original, immutable data dump.
├── docs <- Directory for Sphinx documentation as in the standard PyScaffold setup.
├── environment.yaml <- The conda environment file for reproducing the analysis environment.
├── models <- Trained and serialized models, model predictions, or model summaries
├── notebooks <- Jupyter notebooks. Naming convention is a number (for ordering),
│ the creator's initials, and a short `-` delimited description, e.g.
│ `1.0-fw-initial-data-exploration`.
├── references <- Data dictionaries, manuals, and all other explanatory materials.
├── reports <- Generated analysis as HTML, PDF, LaTeX, etc.
│ └── figures <- Generated graphics and figures to be used in reporting
├── scripts <- Analysis and production scripts which import the actual PYTHON_PKG,
│ e.g. train_model, run_model. etc.
├── setup.cfg <- Declarative configuration of your project.
├── setup.py <- Make this project pip installable with `pip install -e`
│ or `python setup.py develop`.
├── setup.py <- Make this project pip installable with `pip install -e`
│ or `python setup.py develop`.
├── src
│ └── PYTHON_PKG <- Actual Python package where the main functionality goes.
├── tests <- Unit tests which can be run with `py.test` or `python setup.py test`.
├── .coveragerc <- Configuration for coverage reports of unit tests.
├── .isort.cfg <- Configuration for git hook that sorts imports.
└── .pre-commit-config.yaml <- Configuration of pre-commit git hooks.
Expand All @@ -67,7 +67,7 @@ the the documentation of [PyScaffold] for more information.
## Usage

Just install this package with `pip install pyscaffoldext-dsproject`
and note that `putup -h` shows a new option `--dsproject`.
and note that `putup -h` shows a new option `--dsproject`.
Creating a data science project is then as easy as:
```
putup --dsproject my_ds_project
Expand All @@ -85,4 +85,5 @@ information on PyScaffold see https://pyscaffold.org/.
[dsproject-demo]: https://github.com/pyscaffold/dsproject-demo
[Sphinx]: http://www.sphinx-doc.org/
[py.test]: https://docs.pytest.org/
[conda]: https://docs.conda.io/
[pre-commit]: https://pre-commit.com/
4 changes: 2 additions & 2 deletions src/pyscaffoldext/dsproject/templates/readme_md.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A longer description of your project goes here...

In order to set up the necessary environment:

1. create an environment `${project}` with the help of [Miniconda],
1. create an environment `${project}` with the help of [conda],
```
conda env create -f environment.yaml
```
Expand Down Expand Up @@ -107,7 +107,7 @@ Then take a look into the `experiments` and `notebooks` folder.
This project has been set up using PyScaffold ${version}. For details and usage
information on PyScaffold see https://pyscaffold.org/.

[Miniconda]: https://docs.conda.io/en/latest/miniconda.html
[conda]: https://docs.conda.io/
[pre-commit]: https://pre-commit.com/
[Jupyter]: https://jupyter.org/
[nbstripout]: https://github.com/kynan/nbstripout
9 changes: 6 additions & 3 deletions src/pyscaffoldext/dsproject/templates/train_model_py.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ _logger = logging.getLogger(__name__)


@click.command()
@click.option('-c', '--config', 'cfg_path', required=True, type=click.Path(exists=True),
help='path to config file')
@click.option('-c', '--config', 'cfg_path', required=True,
type=click.Path(exists=True), help='path to config file')
@click.option('--quiet', 'log_level', flag_value=logging.WARNING, default=True)
@click.option('-v', '--verbose', 'log_level', flag_value=logging.INFO)
@click.option('-vv', '--very-verbose', 'log_level', flag_value=logging.DEBUG)
@click.version_option(${package}.__version__)
def main(cfg_path: Path, log_level: int):
logging.basicConfig(stream=sys.stdout, level=log_level)
logging.basicConfig(stream=sys.stdout,
level=log_level,
datefmt='%Y-%m-%d %H:%M',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# YOUR CODE GOES HERE! Keep the main functionality in src/${package}
# est = ${package}.models.Estimator()

Expand Down

0 comments on commit 5c584c1

Please sign in to comment.