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
48781179
Commit
48781179
authored
1 year ago
by
Hannes Feldt
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-1582
: Construct HDF5 files after each observation
parent
161a5d8e
No related branches found
No related tags found
1 merge request
!3
L2SS-1582: Construct HDF5 files after each observation
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+3
-5
3 additions, 5 deletions
README.md
infra/jobs/station/stingray.levant.nomad
+4
-0
4 additions, 0 deletions
infra/jobs/station/stingray.levant.nomad
lofar_stingray/writer.py
+4
-4
4 additions, 4 deletions
lofar_stingray/writer.py
tests/test_writer.py
+2
-2
2 additions, 2 deletions
tests/test_writer.py
with
13 additions
and
11 deletions
README.md
+
3
−
5
View file @
48781179
...
...
@@ -12,10 +12,8 @@ pip install .
## Usage
```
python
from
lofar_stingray
import
cool_module
cool_module
.
greeter
()
# prints "Hello World"
```
bash
l2ss-stingray-record <
source
>
<target>
```
## Contributing
...
...
@@ -29,7 +27,7 @@ changes is done through `tox`.
```
pip install tox```
With tox the same jobs as run on the CI/CD pipeline can be r
a
n. These
With tox the same jobs as run on the CI/CD pipeline can be r
u
n. These
include unit tests and linting.
```
tox
```
...
...
This diff is collapsed.
Click to expand it.
infra/jobs/station/stingray.levant.nomad
+
4
−
0
View file @
48781179
...
...
@@ -12,6 +12,10 @@ job "statistics" {
group
"stingray-[[ $af ]]"
{
count
=
1
network
{
mode
=
"bridge"
}
[[
range
$st
,
$port
:=
$fields
]]
task
"stingray-[[ $af ]]-[[ $st ]]"
{
driver
=
"docker"
...
...
This diff is collapsed.
Click to expand it.
lofar_stingray/writer.py
+
4
−
4
View file @
48781179
# Copyright (C) 202
3
ASTRON (Netherlands Institute for Radio Astronomy)
# Copyright (C) 202
4
ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
"""
Implements a storage class to write text data to a S3 backend in blocks
"""
...
...
@@ -80,11 +80,11 @@ class Storage:
async
def
_complete_current_block
(
self
,
block
):
logger
.
info
(
"
Write block %s
"
,
block
.
start
)
block
.
seek
(
io
.
SEEK_SET
,
0
)
sta
rt
=
block
.
start
time
sta
mp
=
datetime
.
now
(
timezone
.
utc
)
self
.
_minio_client
.
put_object
(
self
.
bucket
,
f
"
{
self
.
prefix
}
/
{
sta
rt
.
year
}
/
{
sta
rt
.
month
}
/
{
sta
rt
.
day
}
/
"
f
"
{
sta
rt
.
isoformat
()
}
.json
"
,
f
"
{
self
.
prefix
}
/
{
time
sta
mp
.
year
}
/
{
time
sta
mp
.
month
:
02
d
}
/
{
time
sta
mp
.
day
:
02
d
}
/
"
f
"
{
time
sta
mp
.
isoformat
()
}
.json
"
,
block
,
len
(
block
.
getvalue
()),
content_type
=
"
application/json
"
,
...
...
This diff is collapsed.
Click to expand it.
tests/test_writer.py
+
2
−
2
View file @
48781179
# Copyright (C) 202
3
ASTRON (Netherlands Institute for Radio Astronomy)
# Copyright (C) 202
4
ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
"""
Testing of the writer module
"""
...
...
@@ -67,7 +67,7 @@ class TestStorage(TestCase):
storage
.
write_line
(
"
test2
"
)
self
.
mock_minio
.
put_object
.
assert_called_with
(
"
bucket
"
,
"
prefix/2023/11/2
4
/2023-11-2
4
T12:12:12+00:00.json
"
,
"
prefix/2023/11/2
5
/2023-11-2
5
T12:12:12+00:00.json
"
,
ANY
,
len
(
b
"
test
\n
"
),
content_type
=
"
application/json
"
,
...
...
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