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-commons
Commits
c118339e
Commit
c118339e
authored
Apr 22, 2022
by
Wei Shoulin
Browse files
new id
parent
6df5b472
Changes
2
Hide whitespace changes
Inline
Side-by-side
csst_dfs_commons/models/common.py
View file @
c118339e
...
@@ -21,6 +21,8 @@ class BaseModel:
...
@@ -21,6 +21,8 @@ class BaseModel:
return
self
return
self
def
from_proto_model
(
self
,
record
):
def
from_proto_model
(
self
,
record
):
if
record
is
None
:
return
None
for
k
in
self
.
__dataclass_fields__
.
keys
():
for
k
in
self
.
__dataclass_fields__
.
keys
():
self
.
__setattr__
(
k
,
record
.
__getattribute__
(
k
))
self
.
__setattr__
(
k
,
record
.
__getattribute__
(
k
))
return
self
return
self
...
...
csst_dfs_commons/models/facility.py
View file @
c118339e
...
@@ -39,21 +39,21 @@ class DetectorStatus(BaseModel):
...
@@ -39,21 +39,21 @@ class DetectorStatus(BaseModel):
@
dataclasses
.
dataclass
@
dataclasses
.
dataclass
class
Brick
(
BaseModel
):
class
Brick
(
BaseModel
):
id
:
int
=
0
id
:
int
=
-
1
ra
:
float
=
0.0
ra
:
float
=
0.0
dec
:
float
=
0.0
dec
:
float
=
0.0
boundingbox
:
str
=
""
boundingbox
:
str
=
""
@
dataclasses
.
dataclass
@
dataclasses
.
dataclass
class
BrickObsStatus
(
BaseModel
):
class
BrickObsStatus
(
BaseModel
):
brick_id
:
int
=
0
brick_id
:
int
=
-
1
band
:
str
=
""
band
:
str
=
""
cover_num
:
int
=
0
cover_num
:
int
=
0
update_time
:
str
=
""
update_time
:
str
=
""
@
dataclasses
.
dataclass
@
dataclasses
.
dataclass
class
BrickLevel1
(
BaseModel
):
class
BrickLevel1
(
BaseModel
):
brick_id
:
int
=
0
brick_id
:
int
=
-
1
level1_id
:
int
=
0
level1_id
:
int
=
0
obs_id
:
str
=
""
obs_id
:
str
=
""
module
:
str
=
""
module
:
str
=
""
...
@@ -83,7 +83,7 @@ class Level2ProducerRuning(BaseModel):
...
@@ -83,7 +83,7 @@ class Level2ProducerRuning(BaseModel):
id
:
int
=
0
id
:
int
=
0
job_id
:
int
=
0
job_id
:
int
=
0
producer_id
:
int
=
0
producer_id
:
int
=
0
brick_id
:
int
=
0
brick_id
:
int
=
-
1
start_time
:
str
=
""
start_time
:
str
=
""
end_time
:
str
=
""
end_time
:
str
=
""
prc_status
:
int
=
0
prc_status
:
int
=
0
...
...
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