Skip to content

Commit e429194

Browse files
Merge pull request #452 from vincent-antaki/documentation-update
Documentation update
2 parents 9f229c3 + a2f3a46 commit e429194

7 files changed

+57
-46
lines changed

examples/Handler Methods.ipynb

+24-24
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@
2525
"\n",
2626
"### [handle_fit_transform](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep.handle_fit)\n",
2727
"\n",
28-
"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",
29-
"2. [_will_fit_transform(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._will_fit_transform): Apply side effects before fit_transform\n",
30-
"3. [_fit_transform_data_container(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_transform_data_container): Fit transform data container.\n",
31-
"4. [_did_fit_transform(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._did_fit_transform): Apply side effects after fit_transform.\n",
32-
"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",
28+
"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",
29+
"2. [\\_will\\_fit_transform(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._will_fit_transform): Apply side effects before fit_transform\n",
30+
"3. [\\_fit\\_transform\\_data\\_container(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_transform_data_container): Fit transform data container.\n",
31+
"4. [\\_did\\_fit\\_transform(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._did_fit_transform): Apply side effects after fit_transform.\n",
32+
"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",
3333
"\n",
3434
"### [handle_fit](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep.handle_fit)\n",
3535
"\n",
36-
"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",
37-
"2. [_will_fit(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._will_fit): Apply side effects before fit.\n",
38-
"3. [_fit_data_container(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_data_container): Fit data container.\n",
39-
"4. [_did_fit(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._did_fit): Apply side effects after fit.\n",
36+
"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",
37+
"2. [\\_will\\_fit(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._will_fit): Apply side effects before fit.\n",
38+
"3. [\\_fit\\_data\\_container(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_data_container): Fit data container.\n",
39+
"4. [\\_did\\_fit(data_container, context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._did_fit): Apply side effects after fit.\n",
4040
"\n",
4141
"### [handle_transform](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep.handle_transform)\n",
4242
"\n",
43-
"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",
44-
"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-
"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",
46-
"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",
47-
"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",
43+
"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",
44+
"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+
"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",
46+
"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",
47+
"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",
4848
"\n",
4949
"### When to use handler methods ? \n",
5050
"\n",
@@ -169,9 +169,9 @@
169169
"cell_type": "markdown",
170170
"metadata": {},
171171
"source": [
172-
"2. Implement [_transform_data_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._transform_data_container): \n",
172+
"2. Implement [\\_transform\\_data\\_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._transform_data_container): \n",
173173
"\n",
174-
"Pass expected outputs to the wrapped step [handle_transform](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base.BaseStep.handle_transform) method. Update the data container expected outputs with the outputs."
174+
"Pass expected outputs to the wrapped step [handle_transform](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep.handle_transform) method. Update the data container expected outputs with the outputs."
175175
]
176176
},
177177
{
@@ -198,7 +198,7 @@
198198
"cell_type": "markdown",
199199
"metadata": {},
200200
"source": [
201-
"2. Implement [_fit_data_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_data_container): \n",
201+
"2. Implement [\\_fit\\_data\\_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_data_container): \n",
202202
"\n",
203203
"Pass expected outputs to the wrapped step [handle_fit](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep.handle_fit) method. Update the data container expected outputs with the outputs."
204204
]
@@ -225,7 +225,7 @@
225225
"cell_type": "markdown",
226226
"metadata": {},
227227
"source": [
228-
"3. Implement [_fit_transform_data_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_transform_data_container): \n",
228+
"3. Implement [\\_fit\\_transform\\_data\\_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_transform_data_container): \n",
229229
"\n",
230230
"Pass expected outputs to the wrapped step [handle_fit_transform](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep.handle_fit_transform) method.\n",
231231
"Update the data container expected outputs with the outputs."
@@ -379,7 +379,7 @@
379379
"cell_type": "markdown",
380380
"metadata": {},
381381
"source": [
382-
"2. Implement the [_will_process](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._will_process) lifecycle method to expand the data inside the data container."
382+
"2. Implement the [\\_will\\_process](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._will_process) lifecycle method to expand the data inside the data container."
383383
]
384384
},
385385
{
@@ -397,7 +397,7 @@
397397
"cell_type": "markdown",
398398
"metadata": {},
399399
"source": [
400-
"3. Implement the [_did_process](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._did_process) lifecycle method to reduce the dimension of the data inside the data container."
400+
"3. Implement the [\\_did\\_process](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._did_process) lifecycle method to reduce the dimension of the data inside the data container."
401401
]
402402
},
403403
{
@@ -514,7 +514,7 @@
514514
"cell_type": "markdown",
515515
"metadata": {},
516516
"source": [
517-
"1. Create a step that inherits from [HandleOnlyMixin](https://www.neuraxle.org/stable/api/neuraxle.base.html?highlight=handleonlymixin#neuraxle.base.HandleOnlyMixin), and [TruncableSteps](). Initialize TruncableSteps with a preprocessing, and a postprocessing step."
517+
"1. Create a step that inherits from [HandleOnlyMixin](https://www.neuraxle.org/stable/api/neuraxle.base.html?highlight=handleonlymixin#neuraxle.base.HandleOnlyMixin), and [TruncableSteps](https://www.neuraxle.org/stable/api/neuraxle.base.html?highlight=truncable%20step#neuraxle.base.TruncableSteps). Initialize TruncableSteps with a preprocessing, and a postprocessing step."
518518
]
519519
},
520520
{
@@ -536,7 +536,7 @@
536536
"cell_type": "markdown",
537537
"metadata": {},
538538
"source": [
539-
"2. Implement [_fit_data_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_data_container): "
539+
"2. Implement [\\_fit\\_data\\_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_data_container): "
540540
]
541541
},
542542
{
@@ -558,7 +558,7 @@
558558
"cell_type": "markdown",
559559
"metadata": {},
560560
"source": [
561-
"3. Implement [_transform_data_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._transform_data_container): "
561+
"3. Implement [\\_transform\\_data\\_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep._transform_data_container): "
562562
]
563563
},
564564
{
@@ -590,7 +590,7 @@
590590
"cell_type": "markdown",
591591
"metadata": {},
592592
"source": [
593-
"4. Implement [_fit_transform_data_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_transform_data_container): "
593+
"4. Implement [\\_fit\\_transform\\_data\\_container](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep._fit_transform_data_container): "
594594
]
595595
},
596596
{

examples/Step Saving And Lifecycle.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
"cell_type": "markdown",
2323
"metadata": {},
2424
"source": [
25-
"1. [BaseStep.__init__(hyperparams, hyperparams_space, name)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base.BaseStep): This is where you initialize all of your props, and fitted state. \n",
25+
"1. [BaseStep.\\_\\_init\\_\\_(hyperparams, hyperparams_space, name)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base.BaseStep): This is where you initialize all of your props, and fitted state. \n",
2626
"2. [set_hyperparams(hyperperparams)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._HasHyperparams.set_hyperparams): Configure your steps' hyperparameters before initializing it.\n",
27-
"3. [setup(context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base.TransformerStep.setup): Initialize the step before it runs. Only from here and not before that heavy things should be created (e.g.: things inside GPU), and NOT in the constructor.\n",
27+
"3. [setup(context)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base.BaseTransformer.setup): Initialize the step before it runs. Only from here and not before that heavy things should be created (e.g.: things inside GPU), and NOT in the constructor.\n",
2828
"4. [fit(data_inputs, expected_outputs)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._FittableStep.fit): Fit step with the given data inputs, and expected outputs.\n",
2929
"\n",
3030
"5. [transform(data_inputs)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._TransformerStep.transform): Transform given data inputs.\n",
3131
"6. [save(context, full_dump)](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base._HasSavers.save): Save step using the execution context to create the directory to save the step into.\n",
32-
"7. [teardown()](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base.TransformerStep.teardown): Teardown step after program execution. Inverse of setup, and it should clear memory. Override this method if you need to clear memory."
32+
"7. [teardown()](https://www.neuraxle.org/stable/api/neuraxle.base.html#neuraxle.base.BaseTransformer.teardown): Teardown step after program execution. Inverse of setup, and it should clear memory. Override this method if you need to clear memory."
3333
]
3434
},
3535
{

neuraxle/base.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ def set_hyperparams(self, hyperparams: HyperparameterSamples) -> 'BaseTransforme
14261426
:return: self
14271427
14281428
.. note::
1429-
This is a recursive method that will call :func:`~neuraxle.base._HasHyperparams._set_hyperparams` in the end.
1429+
This is a recursive method that will call :func:`~neuraxle.base._HasHyperparams._set_hyperparams`.
14301430
.. seealso::
14311431
:class:`~neuraxle.hyperparams.space.HyperparameterSamples`,
14321432
:class:̀_HasChildrenMixin`,
@@ -1488,9 +1488,9 @@ def get_hyperparams(self) -> HyperparameterSamples:
14881488
:return: step hyperparameters
14891489
14901490
.. note::
1491-
This is a recursive method that will call :func:`~neuraxle.base._HasHyperparams._get_hyperparams` in the end.
1491+
This is a recursive method that will call :func:`~neuraxle.base._HasHyperparams._get_hyperparams`.
14921492
.. seealso::
1493-
* :class:`~neuraxle.hyperparams.space.HyperparameterSamples`
1493+
:class:`~neuraxle.hyperparams.space.HyperparameterSamples`,
14941494
:class:̀_HasChildrenMixin`,
14951495
:func:`BaseStep.apply`,
14961496
:func:`_HasChildrenMixin._apply`,
@@ -1514,7 +1514,7 @@ def set_params(self, **params) -> 'BaseTransformer':
15141514
hyperparams = s.get_params()
15151515
assert hyperparams == {"learning_rate": 0.1}
15161516
1517-
:param **params: arbitrary number of arguments for hyperparameters
1517+
:param arbitrary number of arguments for hyperparameters
15181518
15191519
.. note::
15201520
This is a recursive method that will call :func:`~neuraxle.base._HasHyperparams._set_params` in the end.
@@ -2121,8 +2121,10 @@ def invalidate(self) -> 'BaseTransformer':
21212121
* the step name has changed func:`~neuraxle.base.BaseStep.set_name`
21222122
21232123
:return: self
2124+
21242125
.. note::
21252126
This is a recursive method used in :class:̀_HasChildrenMixin`.
2127+
21262128
.. seealso::
21272129
:func:`~neuraxle.base._HasRecursiveMethods.apply`,
21282130
:func:`~neuraxle.base._HasChildrenMixin._apply`
@@ -2195,6 +2197,7 @@ def reverse(self) -> 'BaseTransformer':
21952197
Note: the reverse may fail if there is a pending mutate that was set earlier with ``.will_mutate_to``.
21962198
21972199
:return: a copy of self, reversed. Each contained object will also have been reversed if self is a pipeline.
2200+
21982201
.. seealso::
21992202
:func:`~neuraxle.base._TransformerStep.inverse_transform`
22002203
"""
@@ -3003,9 +3006,9 @@ def _refresh_steps(self):
30033006
def should_save(self):
30043007
"""
30053008
Returns if the step needs to be saved or not.
3006-
If self should be saved or any of his sub steps, return True.
30073009
3008-
:return:
3010+
:return: If self or any of his sub steps should be saved, returns True.
3011+
30093012
.. seealso::
30103013
:class:`TruncableJoblibStepSaver`
30113014
"""

neuraxle/data_container.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434

3535

3636
class AbsentValuesNullObject:
37-
"""This object, when passed to the default_value_data_inputs argument of the DataContainer.batch method, will return the minibatched data containers such that the last batch won't have the full batch_size if it was incomplete with trailing None values at the end."""
37+
"""
38+
This object, when passed to the default_value_data_inputs argument of the DataContainer.batch method, will return the minibatched data containers such that the last batch won't have the full batch_size if it was incomplete with trailing None values at the end.
39+
"""
3840
pass
3941

4042

@@ -53,7 +55,7 @@ class DataContainer:
5355
5456
.. seealso::
5557
:class:`~neuraxle.base.BaseHasher`,
56-
:class: `neuraxle.base.BaseStep`
58+
:class:`~neuraxle.base.BaseStep`,
5759
:class:`~neuraxle.data_container.DataContainer.AbsentValuesNullObject`
5860
"""
5961

@@ -92,7 +94,7 @@ def set_data_inputs(self, data_inputs: Iterable):
9294
9395
:param data_inputs: data inputs
9496
:type data_inputs: Iterable
95-
:return:
97+
:return: self
9698
"""
9799
self.data_inputs = data_inputs
98100
return self
@@ -103,7 +105,7 @@ def set_expected_outputs(self, expected_outputs: Iterable):
103105
104106
:param expected_outputs: expected outputs
105107
:type expected_outputs: Iterable
106-
:return:
108+
:return: self
107109
"""
108110
self.expected_outputs = expected_outputs
109111
return self
@@ -114,7 +116,7 @@ def set_current_ids(self, current_ids: List[str]):
114116
115117
:param current_ids: data inputs
116118
:type current_ids: List[str]
117-
:return:
119+
:return: self
118120
"""
119121
self.current_ids = current_ids
120122
return self
@@ -124,17 +126,18 @@ def set_summary_id(self, summary_id: str):
124126
Set summary id.
125127
126128
:param summary_id: str
127-
:return:
129+
:return: self
128130
"""
129131
self.summary_id = summary_id
130132
return self
131133

132134
def set_sub_data_containers(self, sub_data_containers: List['DataContainer']):
133135
"""
134136
Set sub data containers
135-
:return:
137+
:return: self
136138
"""
137139
self.sub_data_containers = sub_data_containers
140+
return self
138141

139142
def hash_summary(self):
140143
"""
@@ -206,8 +209,8 @@ def minibatches(
206209
:return: an iterator of DataContainer
207210
:rtype: Iterable[DataContainer]
208211
209-
..seealso
210-
:class:`~neuraxle.data_container.DataContainer.AbsentValuesNullObject`,
212+
.. seealso::
213+
:class:`~neuraxle.data_container.DataContainer.AbsentValuesNullObject`
211214
"""
212215
for i in range(0, len(self.data_inputs), batch_size):
213216
data_container = DataContainer(
@@ -369,7 +372,7 @@ class ExpandedDataContainer(DataContainer):
369372
Sub class of DataContainer to expand data container dimension.
370373
371374
.. seealso::
372-
:class:`DataContainer`,
375+
:class:`DataContainer`
373376
"""
374377

375378
def __init__(self, data_inputs, current_ids, expected_outputs, summary_id, old_current_ids):
@@ -426,7 +429,7 @@ class ZipDataContainer(DataContainer):
426429
Sub class of DataContainer to zip two data sources together.
427430
428431
.. seealso::
429-
:class:`DataContainer`,
432+
:class: `DataContainer`
430433
"""
431434

432435
@staticmethod

0 commit comments

Comments
 (0)