Skip to content

Commit

Permalink
Allow to use existing directory for output
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrukwa committed Apr 5, 2020
1 parent 301f0ec commit f951d93
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
env:
MAJOR: ${{ 2 }}
MINOR: ${{ 5 }}
FIXUP: ${{ 3 }}
FIXUP: ${{ 4 }}
PACKAGE_INIT_FILE: ${{ 'divik/__init__.py' }}
PACKAGE_INIT_FILE_VERSION_LINE: ${{ 1 }}
PACKAGE_SETUP_FILE: ${{ 'setup.py' }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ docker pull gmrukwa/divik
To install specific version, you can specify it in the command, e.g.:

```bash
docker pull gmrukwa/divik:2.5.3
docker pull gmrukwa/divik:2.5.4
```

## Python package
Expand Down Expand Up @@ -79,7 +79,7 @@ pip install divik
or any stable tagged version, e.g.:

```bash
pip install divik==2.5.3
pip install divik==2.5.4
```

If you want to have compatibility with
Expand Down
2 changes: 1 addition & 1 deletion divik/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.5.3'
__version__ = '2.5.4'

from ._summary import plot, reject_split

Expand Down
5 changes: 3 additions & 2 deletions divik/_cli/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ def parse_args():
return parser.parse_args()


def prepare_destination(destination: str, omit_datetime: bool = False) -> str:
def prepare_destination(destination: str, omit_datetime: bool = False,
exist_ok: bool = False) -> str:
if not omit_datetime:
datetime = time.strftime("%Y%m%d-%H%M%S")
destination = os.path.join(destination, datetime)
os.makedirs(destination)
os.makedirs(destination, exist_ok=exist_ok)
return destination


Expand Down
4 changes: 3 additions & 1 deletion divik/_cli/fit_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ def experiment(
destination: str = 'result',
omit_datetime: bool = False,
verbose: bool = False,
exist_ok: bool = False,
):
destination = prepare_destination(destination, omit_datetime)
destination = prepare_destination(
destination, omit_datetime, exist_ok=exist_ok)
dump_gin_args(destination)
setup_logger(destination, verbose)
logging.info(str(model))
Expand Down
4 changes: 2 additions & 2 deletions docs/instructions/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To install latest stable version use::

To install specific version, you can specify it in the command, e.g.::

docker pull gmrukwa/divik:2.5.3
docker pull gmrukwa/divik:2.5.4

Python package
--------------
Expand All @@ -31,7 +31,7 @@ package::

or any stable tagged version, e.g.::

pip install divik==2.5.3
pip install divik==2.5.4

If you want to have compatibility with
`gin-config <https://github.com/google/gin-config>`_, you can install
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
import numpy

__version__ = '2.5.3'
__version__ = '2.5.4'

LINUX_OPTS = {
'extra_link_args': [
Expand Down

0 comments on commit f951d93

Please sign in to comment.