Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Stingray
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
LOFAR2.0
Stingray
Commits
6e5830d1
Commit
6e5830d1
authored
7 months ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Fix for parsing generator
parent
cbadb0e1
No related branches found
No related tags found
No related merge requests found
Pipeline
#89439
passed
7 months ago
Stage: prepare
Stage: lint
Stage: test
Stage: package
Stage: images
Stage: integration
Stage: publish
Stage: deploy
Pipeline: Stingray
#89440
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lofar_stingray/reader/_s3_packet_loader.py
+10
-7
10 additions, 7 deletions
lofar_stingray/reader/_s3_packet_loader.py
with
10 additions
and
7 deletions
lofar_stingray/reader/_s3_packet_loader.py
+
10
−
7
View file @
6e5830d1
...
...
@@ -12,6 +12,7 @@ from datetime import datetime, timedelta
import
time
from
minio
import
Minio
import
minio.datatypes
logger
=
logging
.
getLogger
()
...
...
@@ -42,18 +43,20 @@ class S3PacketLoader: # pylint: disable=too-few-public-methods
self
.
prefix
=
prefix
.
strip
(
"
/
"
)
self
.
block_duration
=
block_duration
def
_list_objects_after
(
self
,
timestamp
:
datetime
)
->
list
:
def
_list_objects_after
(
self
,
timestamp
:
datetime
)
->
list
[
minio
.
datatypes
.
Object
]
:
"""
Return a list of objects that (should) contain packets of and after
the given timestamp.
"""
# NB: The timestamp in the filename is the time when the file was
# completed, so after the last timestamp recorded in the file.
return
self
.
_minio_client
.
list_objects
(
self
.
bucket
,
recursive
=
True
,
prefix
=
f
"
{
self
.
prefix
}
"
,
start_after
=
f
"
{
self
.
prefix
}
/
{
timestamp
.
year
}
/
{
timestamp
.
month
:
02
d
}
/
"
f
"
{
timestamp
.
day
:
02
d
}
/
{
timestamp
.
isoformat
()
}
.json
"
,
return
list
(
self
.
_minio_client
.
list_objects
(
self
.
bucket
,
recursive
=
True
,
prefix
=
f
"
{
self
.
prefix
}
"
,
start_after
=
f
"
{
self
.
prefix
}
/
{
timestamp
.
year
}
/
{
timestamp
.
month
:
02
d
}
/
"
f
"
{
timestamp
.
day
:
02
d
}
/
{
timestamp
.
isoformat
()
}
.json
"
,
)
)
def
wait_for_packets
(
self
,
timestamp
:
datetime
)
->
bool
:
...
...
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