Skip to content

Commit

Permalink
Restructure project (#31)
Browse files Browse the repository at this point in the history
Restructure project
  • Loading branch information
mr-ubik committed Jan 21, 2020
2 parents c6d93aa + 5bc3a2e commit d0d91f4
Show file tree
Hide file tree
Showing 81 changed files with 524 additions and 353 deletions.
15 changes: 15 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[flake8]
# E203: whitespace before ‘:’
# E266: too many leading ‘#’ for block comment
# E501: line too long (82 > 79 characters)
# W503: line break before binary operator
ignore = E203, E266, E501, W503
max-line-length = 88
max-complexity = 18
# C: All C class violations are reported when the user specifies flake8 --max-complexity
# E: All E class violations are "errors" reported by pycodestyle
# F: All F class violations are reported by pyflakes
# W: All W class violations are "warnings" reported by pycodestyle
# B: All B class violations are "bugbear" checks
# B9: All B9 class violations are "bugbear" opinionated checks
select = B,C,E,F,W,T4,B9
7 changes: 0 additions & 7 deletions .isort.cfg

This file was deleted.

7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ addons:
apt:
update: true
install: &requirements
- pip install -r dev-requirements.txt
- pip install -r requirements.txt
- pip install -e .
jobs:
include:
- stage: Tests
install: *requirements
script:
- pip install codecov
- pip --no-cache-dir install --upgrade git+https://github.com/thisch/pytest-sphinx.git pytest
- pip --no-cache-dir install pytest-cov
- pytest -x -s -vvv --doctest-modules ashpy tests --cov=ashpy
- tox -e py37
after_success:
- codecov
- stage: Black
Expand Down
33 changes: 15 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ If you have improvements to AshPy, send us your pull requests! For those
just getting started, please refer to [this](https://github.com/zurutech/ashpy/blob/master/.github/pull_request_template.md) pull request template.

AshPy team members will be assigned to review your pull requests. Once the
pull requests are approved and pass all the tests, your pull request will
pull requests are approved and pass all the tests, your pull request will
be merged into the official codebase.

If you want to contribute, start working through the AshPy codebase,
navigate to the
[Github "issues" tab](https://github.com/zurutech/ashpy/issues) and start
looking through interesting issues.
looking through interesting issues.

### Contribution guidelines and standards

Expand All @@ -44,10 +44,10 @@ AshPy coding style.
(by default) transferred to the AshPy team. This means that the benefit
of the contribution must be compared against the cost of maintaining the
feature.

#### License

We'd love to accept your patches! Before we can take them, you need to understand
We'd love to accept your patches! Before we can take them, you need to understand
that the code you provide will be included with the Apache License.

You can see an example of the licence [here](https://github.com/zurutech/ashpy/blob/master/LICENSE).
Expand All @@ -70,34 +70,31 @@ Please, put the following lincense header in your files.

#### Python coding style

Changes to AshPy Python code should conform to
- Black is our one and only formatter
- We are more lenient with the length of the line
- Changes to AshPy Python code should conform to
[Google Python Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md)

Use `pylint` to check your Python changes. To install `pylint`:

```bash
pip install pylint
```

To check a file with `pylint`:
To run all the lint against your current codebase:

```bash
pylint --rcfile=/tmp/pylintrc myfile.py
tox -e black,pylint,flake8
```

#### Running tests

In order to run the doctests first you need to install the `pytest-sphinx` package and `pytest-cov` package:
In order to run the tests and the doctests:

```bash
pip --no-cache-dir install --upgrade git+https://github.com/thisch/pytest-sphinx.git pytest
pip install pytest-cov
tox -e testenv
```

Then you can run tests with coverage statistics with:
#### Documentation

To generate the documentation either look up the Sphinx docs or simply:

```bash
pytest -x -s -vvv --doctest-modules ashpy --cov=ashpy
tox -e docs
```

## Attribution
Expand Down
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[![Black - Badge](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![CodeFactor](https://www.codefactor.io/repository/github/zurutech/ashpy/badge)](https://www.codefactor.io/repository/github/zurutech/ashpy)

AshPy is a TensorFlow 2.0 library for (**distributed**) training, evaluation, model selection, and fast prototyping.
AshPy is a TensorFlow 2.1 library for (**distributed**) training, evaluation, model selection, and fast prototyping.
It is designed to ease the burden of setting up all the nuances of the architectures built to train complex custom deep learning models.

[Quick Example](#quick-example) | [Features](#features) | [Set Up](#set-up) | [Usage](#usage) | [Dataset Output Format](#dataset-output-format) | [Test](#test)
Expand Down Expand Up @@ -147,10 +147,6 @@ The following README aims to help you understand what you need to do to setup As

### Pip install
```bash
# Depending on GPU support you might want to install
# tensorflow-gpu or tensorflow
pip install tensorflow-gpu==2.0.0beta1
#pip install tensorflow==2.0.0beta1
pip install ashpy
```

Expand Down Expand Up @@ -464,15 +460,8 @@ Where `a` is the input sample, `b` is the label/condition (if any, otherwise fil
To train Pix2Pix-like architecture, that have no `noise` as ConvGenerator input, just return the values in thee format `(tuple(a,b), b)` since the condition is the generator output.

## Test
In order to run the doctests first you need to install the `pytest-sphinx` package and `pytest-cov` package:
In order to run the tests (with the doctests), linting and docs generation simply use `tox`.

```bash
pip --no-cache-dir install --upgrade git+https://github.com/thisch/pytest-sphinx.git pytest
pip install pytest-cov
```

Then you can run tests with coverage statistics with:

```bash
pytest -x -s -vvv --doctest-modules ashpy --cov=ashpy
tox
```
19 changes: 0 additions & 19 deletions dev-requirements.in

This file was deleted.

58 changes: 0 additions & 58 deletions dev-requirements.txt

This file was deleted.

11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build-system]
requires = ["wheel", "setuptools"]
build-backend = "setuptools.build_meta"

[tool.isort]
multi_line_output=3
include_trailing_comma=true
force_grid_wrap=0
use_parentheses=true
line_length=88
skip="docs/source/conf.py"
102 changes: 0 additions & 102 deletions requirements-no-gpu.txt

This file was deleted.

4 changes: 4 additions & 0 deletions requirements.in/base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Core

tensorflow
tensorflow_hub
14 changes: 14 additions & 0 deletions requirements.in/dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Core
-r base.txt

# Dev
rope

# Docs
-r docs.txt

# Linting
-r linting.txt

# Testing
-r test.txt
9 changes: 9 additions & 0 deletions requirements.in/docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Documentation

doc8
# m2r
pydocstyle
sphinx
sphinx-autobuild
sphinx-autodoc-typehints
sphinx-rtd-theme
8 changes: 8 additions & 0 deletions requirements.in/linting.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Linting

black
flake8
flake8-bugbear
isort
mypy
pylint
7 changes: 7 additions & 0 deletions requirements.in/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Testing

codecov
pytest
pytest-cov
tox
-e git+https://github.com/thisch/pytest-sphinx.git#egg=pytest-sphinx

0 comments on commit d0d91f4

Please sign in to comment.