Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions setup_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ VERSION=${1:-"3.8"}
rm -rf test_template
mkdir test_template
cd test_template
virtualenv venv -p "python${VERSION}"
source venv/bin/activate
cd ..
pip install -e .
cd test_template
poetry init
poetry run pip install -e ../.
echo "test
test
0.1.0
test project
y" | python -m workflow.setup_project
pip install -r requirements.txt
deactivate
y" | poetry run python -m workflow.setup_project
poetry install
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.txt
pip install -r requirements.txt
pip install poetry
poetry install
- name: Build
run: |
python setup.py bdist_wheel --python-tag py3
- name: Upload
- name: Packagr Publish
env:
TOKEN: ${{ secrets.GEMFURY_PUSH_TOKEN }}
run: |
curl -F package=@dist/$(ls dist) https://${TOKEN}@push.fury.io/aiwizo/
TWINE_USERNAME: ""
TWINE_PASSWORD: ${{ secrets.PACKAGR_TOKEN }}
URL: ${{ secrets.PACKAGR_URL }}
run:
twine upload dist/* --repository-url https://api.packagr.app/${URL}/
{%- endraw %}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.txt
pip install -r requirements.txt
pip install poetry
poetry install

- name: Lint with flake8
run: |
Expand Down

This file was deleted.

24 changes: 24 additions & 0 deletions template/{{cookiecutter.repository_name}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tool.poetry]
name = "{{cookiecutter.repository_name}}"
version = "{{cookiecutter.package_version}}"
description = "{{cookiecutter.package_description}}"
authors = ["Aiwizo AB"]

[tool.poetry.dependencies]
python = "^3.8"
torch = ">=1.6.0"
numpy = ">=1.19.2"
torchvision = ">=0.7.0"
opencv-python = ">=4.4.0"
ml-workflow = ">=0.8.1"
pytorch-datastream = ">=0.3.6"

[tool.poetry.dev-dependencies]
guildai = ">=0.7.1.dev6"
data-kale = ">=0.1.3"
pylint = ">=2.6.0"
flake8 = ">=3.8.4"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
6 changes: 0 additions & 6 deletions template/{{cookiecutter.repository_name}}/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion template/{{cookiecutter.repository_name}}/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = {{cookiecutter.repository_name}}
author = "Aiwizo"
author = "Aiwizo AB"
author-email = user@aiwizo.com
summary = Simple library for converting kw6 files to jpg and providing a dataset api
description-file =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from {{cookiecutter.package_name}}.datastream.datasets import datasets
from {{cookiecutter.package_name}}.datastream.augmenter import augmenter
from {{cookiecutter.package_name}}.datastream.evaluate_datastreams import (
evaluate_datastreams
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import numpy as np
import pandas as pd
from datastream import Datastream

from {{cookiecutter.package_name}} import problem


def datasets():
datasets = problem.datasets()
datasets['train'] = datasets['train'].split(
key_column='index',
proportions=dict(gradient=0.8, early_stopping=0.2),
stratify_column='class_name',
filepath='{{cookiecutter.package_name}}/splits/early_stopping.json',
)

return dict(
gradient=datasets['train']['gradient'],
early_stopping=datasets['train']['early_stopping'],
compare=datasets['compare'],
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def train_metrics():


def progress_metrics():
return dict(
return dict(
batch_loss=ignite.metrics.RunningAverage(
output_transform=lambda output: output['loss'],
epoch_bound=False,
Expand Down