Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-dfs
csst-dfs-client
Commits
0603a95d
Commit
0603a95d
authored
Dec 31, 2024
by
Wei Shoulin
Browse files
default dataset and batch_id
parent
6fbdae8e
Pipeline
#7636
failed with stages
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_dfs_client/level1.py
View file @
0603a95d
...
...
@@ -184,10 +184,6 @@ def write(local_file: Union[IO | str],
Returns:
Result: 操作的结果对象,包含操作是否成功以及相关的错误信息,成功返回data为1级数据对象
'''
if
utils
.
is_valid_filename
(
file_name
):
raise
ValueError
(
f
"Incorrect file name [
{
file_name
}
], should be *.*"
)
params
=
{
'module_id'
:
module_id
,
'level0_id'
:
level0_id
,
...
...
@@ -212,8 +208,8 @@ def write(local_file: Union[IO | str],
def
generate_prc_msg
(
module_id
:
Literal
[
'MSC'
,
'IFS'
,
'MCI'
,
'HSTDM'
,
'CPIC'
],
level1_id
:
str
,
pipeline_id
:
Optional
[
str
]
=
''
,
dataset
:
Optional
[
str
]
=
N
on
e
,
batch_id
:
Optional
[
str
]
=
N
on
e
)
->
Result
:
dataset
:
str
=
c
on
stants
.
DEFAULT_DATASET
,
batch_id
:
str
=
c
on
stants
.
DEFAULT_BATCH_ID
)
->
Result
:
"""
生成流水线的处理消息
...
...
@@ -253,8 +249,8 @@ def process_list(level1_id: str) -> Result:
def
add_process
(
level1_id
:
str
,
pipeline_id
:
str
,
run_id
:
str
,
dataset
:
Optional
[
str
]
=
N
on
e
,
batch_id
:
Optional
[
str
]
=
N
on
e
,
dataset
:
str
=
c
on
stants
.
DEFAULT_DATASET
,
batch_id
:
str
=
c
on
stants
.
DEFAULT_BATCH_ID
,
prc_time
:
str
=
utils
.
get_current_time
(),
prc_status
:
int
=
-
1024
,
prc_module
:
str
=
""
,
...
...
csst_dfs_client/level2.py
View file @
0603a95d
...
...
@@ -155,8 +155,8 @@ def write(local_file: Union[IO | str],
file_name
:
str
,
pipeline_id
:
str
,
build
:
int
,
dataset
:
Optional
[
str
]
=
N
on
e
,
batch_id
:
Optional
[
str
]
=
N
on
e
,
dataset
:
str
=
c
on
stants
.
DEFAULT_DATASET
,
batch_id
:
str
=
c
on
stants
.
DEFAULT_BATCH_ID
,
**
extra_kwargs
)
->
Result
:
"""
将本地的2级数据文件写入到DFS中
...
...
@@ -180,8 +180,7 @@ def write(local_file: Union[IO | str],
Result: 操作的结果对象,包含操作是否成功以及相关的错误信息,成功返回data为2级数据对象
"""
if
utils
.
is_valid_filename
(
file_name
):
raise
ValueError
(
f
"Incorrect file name [
{
file_name
}
], should be *.*"
)
params
=
{
'module_id'
:
module_id
,
'level0_id'
:
level0_id
,
...
...
tests/test_level0.py
View file @
0603a95d
...
...
@@ -31,12 +31,12 @@ class Level0TestCase(unittest.TestCase):
self
.
assertIsNotNone
(
result
.
data
,
"error message: "
+
result
.
message
)
def
test_update_qc0_status
(
self
):
result
=
level0
.
update_qc0_status
(
level0_id
=
"10
6
09
4
00
03452925
"
,
file_type
=
'SCI'
,
qc0_status
=
1
)
result
=
level0
.
update_qc0_status
(
level0_id
=
"10
1
09
1
00
15799127
"
,
file_type
=
'SCI'
,
qc0_status
=
1
)
print
(
result
)
self
.
assertEqual
(
result
.
code
,
200
,
"error code: "
+
str
(
result
.
code
)
+
", message: "
+
result
.
message
)
def
test_update_prc_status
(
self
):
result
=
level0
.
update_prc_status
(
level0_id
=
"10
6
09
4
00
03452925
"
,
file_type
=
'SCI'
,
prc_status
=
3
)
result
=
level0
.
update_prc_status
(
level0_id
=
"10
1
09
1
00
15799127
"
,
file_type
=
'SCI'
,
prc_status
=
3
)
print
(
result
)
self
.
assertEqual
(
result
.
code
,
200
,
"error code: "
+
str
(
result
.
code
)
+
", message: "
+
result
.
message
)
...
...
@@ -59,6 +59,11 @@ class Level0TestCase(unittest.TestCase):
print
(
result
)
self
.
assertEqual
(
result
.
code
,
200
,
"error code: "
+
str
(
result
.
code
)
+
", message: "
+
result
.
message
)
def
test_add_process
(
self
):
result
=
level0
.
add_process
(
level0_id
=
"1060940003452925"
,
pipeline_id
=
"csst-msc-l1-mbi"
,
run_id
=
"202411071002481234"
,
prc_time
=
"2024-11-07 10:24:12"
,
prc_status
=
1
,
prc_module
=
"MSC"
,
message
=
""
)
result
=
level0
.
add_process
(
level0_id
=
"1060940003452925"
,
pipeline_id
=
"csst-msc-l1-mbi"
,
run_id
=
"202411071002481234"
,
dataset
=
"v93"
,
batch_id
=
"v930batch"
,
prc_time
=
"2024-11-07 10:24:12"
,
prc_status
=
1
,
prc_module
=
"MSC"
,
message
=
""
)
print
(
result
)
self
.
assertEqual
(
result
.
code
,
200
,
"error code: "
+
str
(
result
.
code
)
+
", message: "
+
result
.
message
)
\ No newline at end of file
tests/test_level2.py
View file @
0603a95d
...
...
@@ -51,8 +51,7 @@ class Level2TestCase(unittest.TestCase):
brick_id
=
254
,
pipeline_id
=
"csst-msc-l2-mbi"
,
build
=
1
,
run_id
=
"20241107100248"
,
version
=
"094"
,
dataset
=
"094"
,
prc_status
=
1
)
print
(
result
)
self
.
assertEqual
(
result
.
code
,
200
,
"error code: "
+
str
(
result
.
code
)
+
", message: "
+
result
.
message
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment