Skip to content
This repository was archived by the owner on Jun 22, 2022. It is now read-only.

Commit 55d4672

Browse files
Kamil A. Kaczmarekjakubczakon
Kamil A. Kaczmarek
authored andcommitted
Dev 015 (#116)
* allow to chain operations i.e. preprocessing_block = preprocessing_steps(cfg=cfg).set_mode_inference().set_parameters_upstream(steps_config) * allow to chained operations
1 parent 5f1816d commit 55d4672

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = '0.1'
2828
# The full version, including alpha/beta/rc tags
29-
release = '0.1.14'
29+
release = '0.1.15'
3030

3131

3232
# -- General configuration ---------------------------------------------------

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
setup(name='steppy',
1515
packages=['steppy'],
16-
version='0.1.14',
16+
version='0.1.15',
1717
description='A lightweight, open-source, Python library for fast and reproducible experimentation',
1818
long_description=long_description,
1919
url='https://github.com/minerva-ml/steppy',
20-
download_url='https://github.com/minerva-ml/steppy/archive/0.1.14.tar.gz',
20+
download_url='https://github.com/minerva-ml/steppy/archive/0.1.15.tar.gz',
2121
author='Kamil A. Kaczmarek, Jakub Czakon',
2222
author_email='kamil.kaczmarek@neptune.ml, jakub.czakon@neptune.ml',
2323
keywords=['machine-learning', 'reproducibility', 'pipeline', 'data-science'],

steppy/base.py

+6
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,14 @@ def set_mode_train(self):
414414
and cleans cache for all upstream Steps including this Step.
415415
"""
416416
self._set_mode('train')
417+
return self
417418

418419
def set_mode_inference(self):
419420
"""Applies 'inference' mode to all upstream Steps including this Step
420421
and cleans cache for all upstream Steps including this Step.
421422
"""
422423
self._set_mode('inference')
424+
return self
423425

424426
def reset(self):
425427
"""Reset all upstream Steps to the default training parameters and
@@ -442,6 +444,7 @@ def reset(self):
442444
step_obj.load_persisted_output = DEFAULT_TRAINING_SETUP['load_persisted_output']
443445
logger.info('Step {}, reset all upstream Steps to default training parameters, '
444446
'including this Step'.format(self.name))
447+
return self
445448

446449
def set_parameters_upstream(self, parameters):
447450
"""Set parameters to all upstream Steps including this Step.
@@ -455,12 +458,14 @@ def set_parameters_upstream(self, parameters):
455458
if key == 'experiment_directory':
456459
step_obj._prepare_experiment_directories()
457460
logger.info('set new values to all upstream Steps including this Step.')
461+
return self
458462

459463
def clean_cache_step(self):
460464
"""Clean cache for current step.
461465
"""
462466
logger.info('Step {}, cleaning cache'.format(self.name))
463467
self.output = None
468+
return self
464469

465470
def clean_cache_upstream(self):
466471
"""Clean cache for all steps that are upstream to `self`.
@@ -469,6 +474,7 @@ def clean_cache_upstream(self):
469474
for step in self.all_upstream_steps.values():
470475
logger.info('Step {}, cleaning cache'.format(step.name))
471476
step.output = None
477+
return self
472478

473479
def get_step_by_name(self, name):
474480
"""Extracts step by name from the pipeline.

0 commit comments

Comments
 (0)