Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pypelines
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
HaissLab
Data Management
Pypelines
Commits
528f7621
Commit
528f7621
authored
1 year ago
by
Timothe Jost
Browse files
Options
Downloads
Patches
Plain Diff
fixing pipe load autofind the right step
parent
27ac49d9
No related branches found
No related tags found
No related merge requests found
Pipeline
#126303
passed
1 year ago
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/pypelines/__init__.py
+1
-1
1 addition, 1 deletion
src/pypelines/__init__.py
src/pypelines/disk.py
+5
-1
5 additions, 1 deletion
src/pypelines/disk.py
src/pypelines/pipes.py
+10
-5
10 additions, 5 deletions
src/pypelines/pipes.py
src/pypelines/steps.py
+1
-1
1 addition, 1 deletion
src/pypelines/steps.py
with
17 additions
and
8 deletions
src/pypelines/__init__.py
+
1
−
1
View file @
528f7621
__version__
=
"
0.0.2
6
"
__version__
=
"
0.0.2
7
"
from
.
import
loggs
from
.pipes
import
*
...
...
This diff is collapsed.
Click to expand it.
src/pypelines/disk.py
+
5
−
1
View file @
528f7621
...
...
@@ -23,6 +23,10 @@ class BaseDiskObject(metaclass=ABCMeta):
disk_version
=
None
disk_step
=
None
step
:
"
BaseStep
"
session
:
Session
extra
:
str
def
__init__
(
self
,
session
:
Session
,
step
:
"
BaseStep
"
,
extra
=
""
)
->
None
:
# this object is meant to be short lived. Created, check drive,
# and quickly take action by saving or loading file according to the procedures defined.
...
...
@@ -91,7 +95,7 @@ class BaseDiskObject(metaclass=ABCMeta):
return
None
def
is_matching
(
self
):
if
self
.
is_loadable
()
and
not
self
.
version_deprecated
()
and
not
self
.
step_level_too_low
():
if
self
.
is_loadable
()
and
not
(
self
.
version_deprecated
()
or
self
.
step_level_too_low
()
)
:
return
True
return
False
...
...
This diff is collapsed.
Click to expand it.
src/pypelines/pipes.py
+
10
−
5
View file @
528f7621
...
...
@@ -130,11 +130,16 @@ class BasePipe(metaclass=ABCMeta):
return
function
def
load
(
self
,
session
,
extra
=
""
,
which
:
Literal
[
"
lowest
"
,
"
highest
"
]
=
"
highest
"
):
ordered_steps
=
sorted
(
list
(
self
.
steps
.
values
()),
key
=
lambda
item
:
item
.
get_level
(
selfish
=
True
))
if
which
==
"
lowest
"
:
step
=
ordered_steps
[
0
]
reverse
=
False
else
:
step
=
ordered_steps
[
-
1
]
reverse
=
True
ordered_steps
=
sorted
(
list
(
self
.
steps
.
values
()),
key
=
lambda
item
:
item
.
get_level
(
selfish
=
True
),
reverse
=
reverse
)
return
step
.
load
(
session
,
extra
)
for
step
in
ordered_steps
:
if
step
.
get_disk_object
(
session
,
extra
).
is_matching
():
return
step
.
load
(
session
,
extra
)
raise
ValueError
(
f
"
Could not find a
{
self
}
object to load for the session
{
session
.
alias
}
with extra
{
extra
}
"
)
This diff is collapsed.
Click to expand it.
src/pypelines/steps.py
+
1
−
1
View file @
528f7621
...
...
@@ -143,7 +143,7 @@ class BaseStep:
def
get_load_wrapped
(
self
):
@wraps
(
self
.
pipe
.
disk_class
.
load
)
def
wrapper
(
session
,
extra
=
None
):
def
wrapper
(
session
,
extra
=
None
,
strict
=
False
):
# print("extra in load wrapper : ", extra)
if
extra
is
None
:
extra
=
self
.
get_default_extra
()
...
...
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