Skip to content

Commit a2404c5

Browse files
Merge pull request #525 from Kimoby/updates-for-dashboard
AutoML Results Visualizations Update
2 parents 9369987 + 26c588b commit a2404c5

File tree

102 files changed

+3732
-1891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3732
-1891
lines changed

.coveragerc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[run]
2+
parallel = True
3+
concurrency = multiprocessing, thread
4+
5+
[report]
6+
exclude_lines =
7+
raise NotImplementedError.*
8+
if False:
9+
if 0:
10+
raise AssertionError.*
11+
@(abc\.)?abstractmethod
12+
if __name__ == __main__:
13+

.github/workflows/testpythonpackage.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ jobs:
3535
run: |
3636
pip install flake8
3737
# stop the build if there are Python syntax errors or undefined names
38-
flake8 neuraxle testing --count --select=E9,F63,F7,F82 --show-source --statistics
38+
flake8 neuraxle testing_neuraxle --count --select=E9,F63,F7,F82 --show-source --statistics
3939
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40-
flake8 neuraxle testing --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40+
flake8 neuraxle testing_neuraxle --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4141
- name: Test with pytest
4242
run: |
4343
python setup.py test

.gitignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ venv.bak/
109109
.idea
110110
.vscode
111111
.style.yapf
112-
vandelay-py.js
113-
appmap.yml
112+
*-py.js
113+
*pmap.yml
114114
tmp
115115

116116
# Other
@@ -121,9 +121,9 @@ todo.txt
121121
**caching/**
122122
cache/**
123123
caching/**
124-
testing/examples/cache/**
125-
testing/cache/**
126-
testing/cache/*
124+
testing_neuraxle/examples/cache/**
125+
testing_neuraxle/cache/**
126+
testing_neuraxle/cache/*
127127
cov.xml
128128
profile.sh
129129

coverage.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
22
./flake8.sh
3-
pytest -n 7 --cov-report html --cov-report xml:cov.xml --cov=neuraxle testing
4-
# pytest --cov-report html --cov=neuraxle testing; open htmlcov/index.html
3+
pytest -n 7 --cov-report html --cov-report xml:cov.xml --cov-config=.coveragerc --cov=neuraxle testing_neuraxle
4+
# pytest --cov-report html --cov=neuraxle testing_neuraxle; open htmlcov/index.html
55

examples/Handler Methods.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"### [handle_transform](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep.handle_transform)\n",
4343
"\n",
4444
"1. [\\_will\\_process(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._will_process): Apply side effects before any step method\n",
45-
"2. [\\_will\\_transform(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._will_transform_data_container): Apply side effects before transform.\n",
45+
"2. [\\_will\\_transform(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._will_transform): Apply side effects before transform.\n",
4646
"3. [\\_transform\\_data_container(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._transform_data_container): Fit transform data container.\n",
4747
"4. [\\_did\\_transform(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._did_transform): Apply side effects after transform. \n",
4848
"5. [\\_did\\_process(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._did_process): Apply side effects after any step method.\n",

examples/Step Saving And Lifecycle.ipynb

+21-10
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,31 @@
6666
"metadata": {},
6767
"outputs": [],
6868
"source": [
69-
"from neuraxle.base import BaseSaver, BaseStep, ExecutionContext, Identity\n",
70-
"from queue import Queue\n",
69+
"from multiprocessing import Queue\n",
70+
"from neuraxle.base import BaseSaver, BaseTransformer, ExecutionContext, Identity\n",
71+
"from neuraxle.base import ExecutionContext as CX\n",
72+
"from neuraxle.distributed.streaming import _ProducerConsumerMixin\n",
7173
"\n",
72-
"class ObservableQueueStepSaver(BaseSaver):\n",
73-
" def save_step(self, step: 'BaseStep', context: 'ExecutionContext') -> 'BaseStep':\n",
74-
" step.queue = None\n",
75-
" step.observers = []\n",
74+
"class _ProducerConsumerStepSaver(BaseSaver):\n",
75+
" \"\"\"\n",
76+
" Saver for :class:`_ProducerConsumerMixin`.\n",
77+
" This saver class makes sure that the non-picklable queue\n",
78+
" is deleted upon saving for multiprocessing steps.\n",
79+
" \"\"\"\n",
80+
"\n",
81+
" def save_step(self, step: BaseTransformer, context: 'CX') -> BaseTransformer:\n",
82+
" step: _ProducerConsumerMixin = step # typing.\n",
83+
" step._allow_exit_without_queue_flush()\n",
84+
" step.input_queue = None\n",
85+
" step.consumers = []\n",
7686
" return step\n",
7787
"\n",
78-
" def can_load(self, step: 'BaseStep', context: 'ExecutionContext'):\n",
88+
" def can_load(self, step: BaseTransformer, context: 'CX') -> bool:\n",
7989
" return True\n",
8090
"\n",
81-
" def load_step(self, step: 'BaseStep', context: 'ExecutionContext') -> 'BaseStep':\n",
82-
" step.queue = Queue()\n",
91+
" def load_step(self, step: 'BaseTransformer', context: 'CX') -> 'BaseTransformer':\n",
92+
" step: _ProducerConsumerMixin = step # typing.\n",
93+
" step.input_queue = None\n",
8394
" return step"
8495
]
8596
},
@@ -98,7 +109,7 @@
98109
"source": [
99110
"class IdentityWithQueue(Identity):\n",
100111
" def __init__(self):\n",
101-
" super().__init__(savers=[ObservableQueueStepSaver()])\n",
112+
" super().__init__(savers=[_ProducerConsumerStepSaver()])\n",
102113
"\n",
103114
" def setup(self, context=None):\n",
104115
" if not self.is_initialized:\n",

examples/parallel/plot_streaming_pipeline.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,22 @@ def main():
7171
time_vanilla_pipeline, output_classical = eval_run_time(p)
7272
print(f"Classical 'Pipeline' execution time: {time_vanilla_pipeline} seconds.")
7373

74-
# Classical minibatch pipeline - minibatch size 25:
74+
# Classical minibatch pipeline - minibatch size 5:
7575
p = MiniBatchSequentialPipeline(preprocessing_and_model_steps,
76-
batch_size=25)
76+
batch_size=5)
7777
time_minibatch_pipeline, output_minibatch = eval_run_time(p)
7878
print(f"Minibatched 'MiniBatchSequentialPipeline' execution time: {time_minibatch_pipeline} seconds.")
7979

80-
# Parallel pipeline - minibatch size 25 with 4 parallel workers per step that
80+
# Parallel pipeline - minibatch size 5 with 4 parallel workers per step that
8181
# have a max queue size of 10 batches between preprocessing and the model:
8282
p = SequentialQueuedPipeline(preprocessing_and_model_steps,
83-
n_workers_per_step=4, max_queue_size=10, batch_size=25)
83+
n_workers_per_step=4, max_queued_minibatches=10, batch_size=5)
8484
time_parallel_pipeline, output_parallel = eval_run_time(p)
8585
print(f"Parallel 'SequentialQueuedPipeline' execution time: {time_parallel_pipeline} seconds.")
8686

87-
assert time_parallel_pipeline < time_minibatch_pipeline, str((time_parallel_pipeline, time_vanilla_pipeline))
8887
assert np.array_equal(output_classical, output_minibatch)
8988
assert np.array_equal(output_classical, output_parallel)
89+
assert time_parallel_pipeline < time_minibatch_pipeline, str((time_parallel_pipeline, time_vanilla_pipeline))
9090

9191

9292
if __name__ == '__main__':

flake8.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
2-
flake8 neuraxle testing --count --max-line-length=120 --select=E9,F63,F7,F82 --statistics --show-source
2+
flake8 neuraxle testing_neuraxle --count --max-line-length=120 --select=E9,F63,F7,F82 --statistics --show-source
33

neuraxle/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.1"
1+
__version__ = "0.7.2"

0 commit comments

Comments
 (0)