Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Init Elements
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
Arkindex
Workers
Init Elements
Commits
9710ea5e
Commit
9710ea5e
authored
5 months ago
by
Manon Blanco
Browse files
Options
Downloads
Patches
Plain Diff
Use list_corpus_types
parent
783178ed
No related branches found
Branches containing commit
Tags
0.1.0rc2
Tags containing commit
1 merge request
!15
Draft: Migrate cache to use the Arkindex export structure
Pipeline
#193472
failed
5 months ago
Stage: test
Stage: build
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
worker_init_elements/worker.py
+4
-7
4 additions, 7 deletions
worker_init_elements/worker.py
with
4 additions
and
7 deletions
worker_init_elements/worker.py
+
4
−
7
View file @
9710ea5e
...
...
@@ -10,6 +10,7 @@ from time import sleep
from
arkindex_export
import
Image
as
CachedImage
from
arkindex_export
import
ImageServer
as
CachedImageServer
from
arkindex_worker.worker.element
import
ElementMixin
from
arkindex_export
import
create_database
from
arkindex_worker.cache
import
CachedElement
...
...
@@ -58,7 +59,7 @@ class ActivityState(Enum):
"""
class
InitElementsWorker
(
BaseWorker
):
class
InitElementsWorker
(
BaseWorker
,
ElementMixin
):
def
configure
(
self
)
->
None
:
super
().
configure
()
...
...
@@ -182,13 +183,9 @@ class InitElementsWorker(BaseWorker):
"
corpus
"
),
"
This worker only supports processes on corpora.
"
# TODO: Can't use `from arkindex_worker.worker.element.ElementMixin.list_corpus_types`
# Because `self.corpus_id` is not set?
corpus
=
self
.
api_client
.
request
(
"
RetrieveCorpus
"
,
id
=
self
.
process_information
[
"
corpus
"
]
)
self
.
list_corpus_types
()
type_slugs
=
{
element_type
[
"
id
"
]:
element_type
[
"
slug
"
]
for
element_type
in
corpus
[
"
types
"
]
element_type
[
"
id
"
]:
element_type
[
"
slug
"
]
for
element_type
in
self
.
corpus
_
types
.
values
()
}
elements
=
[
...
...
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