Skip to content

Commit a43e1a9

Browse files
committed
improve: cookiecutter working
1 parent 5c24530 commit a43e1a9

40 files changed

+16
-17
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.0.0"
44
description = "Pytorch project template and related tools"
55
authors = ["Aiwizo"]
66
license = "Apache 2"
7+
include = ["workflow/template/*"]
78

89
[tool.poetry.dependencies]
910
python = "3.8"

test_template.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/usr/bin/env bash
22
set -o errexit -o nounset -o pipefail -o xtrace
33

4+
rm dist/workflow-0.0.0-py3-none-any.whl
5+
poetry build
46
cd test_template
7+
poetry remove workflow
8+
poetry install --remove-untracked
9+
poetry add ../dist/workflow-0.0.0-py3-none-any.whl
510
shopt -s extglob
611
rm -rf .github
712
rm -rf !(pyproject.toml)

workflow/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
from workflow import functional
2+
13
from workflow.figure_to_numpy import figure_to_numpy
24
from workflow.numpy_seed import numpy_seed
35
from workflow.progress_bar import ProgressBar
46
from workflow.early_stopping import EarlyStopping
57

6-
from workflow import functional
7-
from workflow import ignite
88
from workflow import torch
99

1010
from pkg_resources import get_distribution, DistributionNotFound

workflow/functional/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from .interleaved import interleaved
2-
from .repeat_map_chain import repeat_map_chain
3-
from .star import star
4-
from .starcompose import starcompose
5-
from .structure_map import structure_map
1+
from workflow.functional.star import star
2+
from workflow.functional.starcompose import starcompose
3+
from workflow.functional.structure_map import structure_map

workflow/setup_project.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66

77

88
if __name__ == '__main__':
9+
print(__file__ + '/template')
910
try:
1011
repository_path = cookiecutter(
11-
'/'.join(__file__.split('/')[:-5]) + '/workflow/template',
12-
)
13-
except RepositoryNotFound:
14-
# Probably installed with the -e flag
15-
repository_path = cookiecutter(
16-
'/'.join(__file__.split('/')[:-2]) + '/template',
12+
str(Path(__file__).parent / 'template')
1713
)
14+
except RepositoryNotFound as exception:
15+
print('__file__:', __file__)
16+
raise exception
1817

1918
repository_path = Path(repository_path)
2019

File renamed without changes.

workflow/torch/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
from workflow.torch.is_float import is_float
2-
from workflow.torch.get_conv_output_size import get_conv_output_size
3-
from workflow.torch.get_model_summary import get_model_summary
4-
from workflow.torch.initialize_weights import initialize_weights
51
from workflow.torch.module_device import module_device
62
from workflow.torch.module_compose import ModuleCompose
73
from workflow.torch.to_device import to_device

0 commit comments

Comments
 (0)