Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
force-bdss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adham Hashibon
force-bdss
Commits
0f06470c
Commit
0f06470c
authored
6 years ago
by
James Johnson
Browse files
Options
Downloads
Patches
Plain Diff
Renamed things from pop_traits to pop_traits_version
parent
e1454c4d
No related branches found
No related tags found
1 merge request
!152
Removed __traits_version__ from json files
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
force_bdss/io/tests/test_workflow_writer.py
+4
-4
4 additions, 4 deletions
force_bdss/io/tests/test_workflow_writer.py
force_bdss/io/workflow_writer.py
+2
-2
2 additions, 2 deletions
force_bdss/io/workflow_writer.py
with
6 additions
and
6 deletions
force_bdss/io/tests/test_workflow_writer.py
+
4
−
4
View file @
0f06470c
...
@@ -14,7 +14,7 @@ from force_bdss.tests.dummy_classes.factory_registry_plugin import \
...
@@ -14,7 +14,7 @@ from force_bdss.tests.dummy_classes.factory_registry_plugin import \
DummyFactoryRegistryPlugin
DummyFactoryRegistryPlugin
from
force_bdss.io.workflow_writer
import
WorkflowWriter
,
traits_to_dict
,
\
from
force_bdss.io.workflow_writer
import
WorkflowWriter
,
traits_to_dict
,
\
pop_traits
pop_traits
_version
from
force_bdss.core.workflow
import
Workflow
from
force_bdss.core.workflow
import
Workflow
...
@@ -91,11 +91,11 @@ class TestWorkflowWriter(unittest.TestCase):
...
@@ -91,11 +91,11 @@ class TestWorkflowWriter(unittest.TestCase):
def
test_pop_traits_version
(
self
):
def
test_pop_traits_version
(
self
):
test_dictionary
=
{
'
Entry1
'
:
{
'
Entry1-1
'
:
4
,
'
__traits_version__
'
:
67
},
test_dictionary
=
{
'
Entry1
'
:
{
'
Entry1-1
'
:
4
,
'
__traits_version__
'
:
67
},
'
Entry2
'
:
[
3
,
'
a
'
,
{
'
Entry2-1
'
:
5
,
'
Entry2
'
:
[
3
,
'
a
'
,
{
'
Entry2-1
'
:
5
,
'
__traits_version__
'
:
9001
}],
'
__traits_version__
'
:
9001
}],
'
__traits_version__
'
:
13
}
'
__traits_version__
'
:
13
}
result_dictionary
=
{
'
Entry1
'
:
{
'
Entry1-1
'
:
4
,
},
result_dictionary
=
{
'
Entry1
'
:
{
'
Entry1-1
'
:
4
,
},
'
Entry2
'
:
[
3
,
'
a
'
,
{
'
Entry2-1
'
:
5
,
}],
}
'
Entry2
'
:
[
3
,
'
a
'
,
{
'
Entry2-1
'
:
5
,
}],
}
traitless_dictionary
=
pop_traits
(
test_dictionary
)
traitless_dictionary
=
pop_traits
_version
(
test_dictionary
)
self
.
assertEqual
(
traitless_dictionary
,
result_dictionary
)
self
.
assertEqual
(
traitless_dictionary
,
result_dictionary
)
This diff is collapsed.
Click to expand it.
force_bdss/io/workflow_writer.py
+
2
−
2
View file @
0f06470c
...
@@ -111,12 +111,12 @@ def pop_traits_version(dictionary):
...
@@ -111,12 +111,12 @@ def pop_traits_version(dictionary):
for
key
in
dictionary
:
for
key
in
dictionary
:
# If we have a dict, remove the traits version
# If we have a dict, remove the traits version
if
isinstance
(
dictionary
[
key
],
dict
):
if
isinstance
(
dictionary
[
key
],
dict
):
pop_traits
(
dictionary
[
key
])
pop_traits
_version
(
dictionary
[
key
])
# If we have a non-dict which contains a dict, remove traits from
# If we have a non-dict which contains a dict, remove traits from
# that as well
# that as well
elif
isinstance
(
dictionary
[
key
],
Iterable
):
elif
isinstance
(
dictionary
[
key
],
Iterable
):
for
element
in
dictionary
[
key
]:
for
element
in
dictionary
[
key
]:
if
isinstance
(
element
,
dict
):
if
isinstance
(
element
,
dict
):
pop_traits
(
element
)
pop_traits
_version
(
element
)
return
dictionary
return
dictionary
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment