revisit 0.0.16__tar.gz → 0.0.17__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {revisit-0.0.16 → revisit-0.0.17}/PKG-INFO +1 -1
- {revisit-0.0.16 → revisit-0.0.17}/pyproject.toml +1 -1
- {revisit-0.0.16 → revisit-0.0.17}/src/revisit/revisit.py +23 -8
- {revisit-0.0.16 → revisit-0.0.17}/.gitignore +0 -0
- {revisit-0.0.16 → revisit-0.0.17}/README.md +0 -0
- {revisit-0.0.16 → revisit-0.0.17}/src/revisit/StudyConfigSchema.json +0 -0
- {revisit-0.0.16 → revisit-0.0.17}/src/revisit/__init__.py +0 -0
- {revisit-0.0.16 → revisit-0.0.17}/src/revisit/models.py +0 -0
- {revisit-0.0.16 → revisit-0.0.17}/src/revisit/static/widget.css +0 -0
- {revisit-0.0.16 → revisit-0.0.17}/src/revisit/static/widget.js +0 -0
- {revisit-0.0.16 → revisit-0.0.17}/src/revisit/widget.py +0 -0
@@ -10,8 +10,7 @@ import re
|
|
10
10
|
import os
|
11
11
|
import shutil
|
12
12
|
from . import widget as _widget
|
13
|
-
|
14
|
-
import time
|
13
|
+
|
15
14
|
|
16
15
|
__all__ = [
|
17
16
|
"component",
|
@@ -170,6 +169,16 @@ class _WrappedComponentBlock(_JSONableBaseModel):
|
|
170
169
|
numSamples: Optional[int] = None,
|
171
170
|
component_function=None
|
172
171
|
) -> None:
|
172
|
+
|
173
|
+
# Initialize components list with blank component if empty
|
174
|
+
make_comp_block = True
|
175
|
+
if len(self.component_objects__) == 0:
|
176
|
+
self = self + __component__(type='questionnaire', component_name__='place-holder-component')
|
177
|
+
# If there only exists one component (either existing one or placeholder),
|
178
|
+
# do not create the first component blocks.
|
179
|
+
if len(self.component_objects__) == 1:
|
180
|
+
make_comp_block = False
|
181
|
+
|
173
182
|
# Convert to JSON
|
174
183
|
self_json = json.loads(self.__str__())
|
175
184
|
# Get all current component dictionaries
|
@@ -181,7 +190,8 @@ class _WrappedComponentBlock(_JSONableBaseModel):
|
|
181
190
|
order=order,
|
182
191
|
numSamples=numSamples,
|
183
192
|
input_components=components_dict,
|
184
|
-
component_function=component_function
|
193
|
+
component_function=component_function,
|
194
|
+
make_comp_block=make_comp_block
|
185
195
|
)
|
186
196
|
# Set new objects
|
187
197
|
self.component_objects__ = new_permuted_component_block.component_objects__
|
@@ -700,11 +710,12 @@ def _recursive_json_permutation(
|
|
700
710
|
input_json: dict,
|
701
711
|
factors: List[str],
|
702
712
|
order: rvt_models.Order,
|
703
|
-
numSamples: int,
|
704
713
|
input_components: dict,
|
705
|
-
|
714
|
+
numSamples: Optional[int] = None,
|
715
|
+
component_function=None,
|
716
|
+
make_comp_block=True
|
706
717
|
):
|
707
|
-
new_seq = __sequence__(order=order, numSamples=numSamples)
|
718
|
+
new_seq = __sequence__(order=input_json['order'], numSamples=input_json.get('numSamples'))
|
708
719
|
while input_json['components']:
|
709
720
|
c = input_json['components'].pop()
|
710
721
|
# If component name
|
@@ -749,5 +760,9 @@ def _recursive_json_permutation(
|
|
749
760
|
curr_seq.root.order = new_input_json['order']
|
750
761
|
curr_seq.root.numSamples = temp_num_samples
|
751
762
|
new_seq = new_seq + curr_seq
|
752
|
-
|
753
|
-
|
763
|
+
|
764
|
+
# Only return curr sequence if not making the comp block.
|
765
|
+
if make_comp_block is True:
|
766
|
+
return new_seq
|
767
|
+
else:
|
768
|
+
return curr_seq
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|