Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aliby-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Swain Lab
aliby
aliby-mirror
Commits
eccf820d
Commit
eccf820d
authored
3 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
yaml is alive!
Former-commit-id: 6ea363c356a58fb0b5dcc86b431f5eeb32a968a2
parent
ddfad924
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/processes/base.py
+7
-2
7 additions, 2 deletions
core/processes/base.py
core/processes/picker.py
+1
-1
1 addition, 1 deletion
core/processes/picker.py
with
8 additions
and
3 deletions
core/processes/base.py
+
7
−
2
View file @
eccf820d
...
@@ -2,6 +2,8 @@ from pathlib import Path, PosixPath
...
@@ -2,6 +2,8 @@ from pathlib import Path, PosixPath
from
typing
import
Union
from
typing
import
Union
from
abc
import
ABC
,
abstractmethod
from
abc
import
ABC
,
abstractmethod
from
yaml
import
safe_load
,
dump
class
ParametersABC
(
ABC
):
class
ParametersABC
(
ABC
):
"""
"""
...
@@ -16,8 +18,11 @@ class ParametersABC(ABC):
...
@@ -16,8 +18,11 @@ class ParametersABC(ABC):
def
from_dict
(
cls
,
d
:
dict
):
def
from_dict
(
cls
,
d
:
dict
):
return
cls
(
**
d
)
return
cls
(
**
d
)
def
to_yaml
(
self
,
path
:
Union
[
PosixPath
,
str
]):
def
to_yaml
(
self
,
path
:
Union
[
PosixPath
,
str
]
=
None
):
return
dump
(
self
.
__dict__
,
path
)
if
path
:
with
open
(
Path
(
path
),
"
w
"
)
as
f
:
dump
(
self
.
to_dict
(),
f
)
return
dump
(
self
.
to_dict
())
@classmethod
@classmethod
def
from_yaml
(
cls
,
path
:
Union
[
PosixPath
,
str
]):
def
from_yaml
(
cls
,
path
:
Union
[
PosixPath
,
str
]):
...
...
This diff is collapsed.
Click to expand it.
core/processes/picker.py
+
1
−
1
View file @
eccf820d
...
@@ -25,7 +25,7 @@ class PickerParameters(ParametersABC):
...
@@ -25,7 +25,7 @@ class PickerParameters(ParametersABC):
def
default
(
cls
):
def
default
(
cls
):
return
cls
.
from_dict
(
return
cls
.
from_dict
(
{
{
"
condition
"
:
(
"
present
"
,
0.8
)
,
"
condition
"
:
[
"
present
"
,
0.8
]
,
"
lineage
"
:
None
,
"
lineage
"
:
None
,
"
sequence
"
:
[
"
lineage
"
,
"
condition
"
],
"
sequence
"
:
[
"
lineage
"
,
"
condition
"
],
}
}
...
...
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