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-pipeline
csst_common
Commits
d41d9035
Commit
d41d9035
authored
Jul 11, 2023
by
BO ZHANG
🏀
Browse files
add filter_warnings
parent
0e355e6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/pipeline.py
View file @
d41d9035
import
json
import
os.path
import
subprocess
import
warnings
from
astropy
import
time
...
...
@@ -22,6 +23,7 @@ class Pipeline:
n_jobs_cpu
=
18
,
n_jobs_gpu
=
9
,
device
=
"CPU"
,
filter_warnings
=
False
,
):
self
.
dir_in
=
dir_in
self
.
dir_out
=
dir_out
...
...
@@ -54,6 +56,9 @@ class Pipeline:
self
.
dfs
=
DFS
(
n_try
=
5
)
self
.
crds
=
CRDS
()
if
filter_warnings
:
self
.
filter_warnings
()
def
set_test_env
(
self
):
os
.
environ
[
"CSST_DFS_API_MODE"
]
=
"cluster"
os
.
environ
[
"CSST_DFS_GATEWAY"
]
=
"172.24.27.2:30880"
...
...
@@ -71,6 +76,16 @@ class Pipeline:
def
now
(
self
):
return
time
.
Time
.
now
().
isot
@
staticmethod
def
filter_warnings
():
# Suppress all warnings
warnings
.
filterwarnings
(
"ignore"
)
@
staticmethod
def
reset_warnings
(
self
):
# Reset warning filters
warnings
.
resetwarnings
()
class
Message
:
def
__init__
(
self
,
file_path
=
""
):
...
...
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