Commit 70c2067b authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

update msc cli

parent 33f289fe
...@@ -28,11 +28,11 @@ DAG_LOOP_MAP = { ...@@ -28,11 +28,11 @@ DAG_LOOP_MAP = {
} }
for obs_type, dag_ids in DAG_LOOP_MAP.items(): for obs_type, dag_ids in DAG_LOOP_MAP.items():
print(f"Processing {obs_type}") print(f"* Processing {obs_type}")
for dag_id in dag_ids: for dag_id in dag_ids:
print(f" - {dag_id}") print(f" - {dag_id} ··· ", end="")
dag = dags.get_dag(dag_id=dag_id) dag = dags.get_dag(dag_id=dag_id)
dag.schedule( msgs = dag.schedule(
dataset=args.dataset, dataset=args.dataset,
obs_type=args.obs_type, obs_type=args.obs_type,
project_id=args.project_id, project_id=args.project_id,
...@@ -41,3 +41,4 @@ for obs_type, dag_ids in DAG_LOOP_MAP.items(): ...@@ -41,3 +41,4 @@ for obs_type, dag_ids in DAG_LOOP_MAP.items():
final_prc_status=-2, final_prc_status=-2,
demo=True, demo=True,
) )
print(f"{len(msgs)} tasks scheduled.")
...@@ -23,26 +23,6 @@ class CsstDAG: ...@@ -23,26 +23,6 @@ class CsstDAG:
assert dag_id in DAG_LIST, f"{dag_id} not in DAG_LIST" assert dag_id in DAG_LIST, f"{dag_id} not in DAG_LIST"
return DAG_MAP[dag_id] return DAG_MAP[dag_id]
def trigger( @staticmethod
self, def get_all():
dag_id: str = "", return DAG_MAP
**kwargs,
):
pass
def schedule(
self,
dag_id: str = "",
**kwargs,
):
pass
def push(
self,
dag_id: str = "",
**kwargs,
):
pass
dags = CsstDAG()
from csst_dag.constants import MSC_MBI_CHIPID
from csst_dag import DFS
from csst_dfs_client import plan, level0
from ..dag._dag_list import DAG_LIST
class CsstMscL1Mbi:
def __init__(self):
pass
@staticmethod
def schedule(
dag_id: str = "csst-msc-l1-mbi",
dataset: str = "csst-msc-c9-25sqdeg-v3",
obs_type: str = "WIDE",
project_id: str = "none",
batch_id: str | None = "default",
**kwargs,
):
pass
# Write plan to DFS
# result = plan.write_file("/nfs/simulation-collection/csst-msc-c9-25sqdeg-v3/plan.json")
# print(result)
# search plan
# # plan.find(instrument="MSC")
# res_plan = plan.find(
# dataset="csst-msc-c9-25sqdeg-v3",
# instrument="MSC",
# obs_type="WIDE",
# project_id="none",
# )
# print(res_plan.data[0])
# assert res_plan.success, res_plan.message
res_level0 = level0.find(
dataset="csst-msc-c9-25sqdeg-v3",
instrument="MSC",
obs_type="WIDE",
prc_status=-1024,
)
# process as there is
for rec in res_level0.data:
print(rec)
print(res_level0.data[0])
print(res_level0.data[0].keys())
print(res_level0)
assert res_level0.success, res_level0.message
# 不对project的数据完整性进行检查,只对数据的存在性进行检查
# print(__file__)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment