From 18392278f139f1a33ee8c275e791ac1eef511915 Mon Sep 17 00:00:00 2001 From: devsjc Date: Fri, 20 Oct 2023 14:59:03 +0100 Subject: [PATCH] Formatting --- dags_tests/cams_test.py | 5 +++-- nwp/assets/cams/cams.py | 6 ++---- nwp/jobs.py | 7 ++----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/dags_tests/cams_test.py b/dags_tests/cams_test.py index 0bebb2f..3a7fb58 100644 --- a/dags_tests/cams_test.py +++ b/dags_tests/cams_test.py @@ -1,7 +1,8 @@ -from nwp.assets.cams import fetch_cams_forecast_for_day +import datetime as dt import unittest -import datetime as dt +from nwp.assets.cams import fetch_cams_forecast_for_day + class TestCams(unittest.TestCase): def test_cams(self): diff --git a/nwp/assets/cams/cams.py b/nwp/assets/cams/cams.py index 355cf81..99e5b14 100644 --- a/nwp/assets/cams/cams.py +++ b/nwp/assets/cams/cams.py @@ -1,8 +1,7 @@ +import datetime as dt + import cdsapi import dagster -import os - -import datetime as dt c = cdsapi.Client() @@ -80,7 +79,6 @@ class CAMSConfig(dagster.Config): @dagster.op def fetch_cams_forecast_for_day(context: dagster.OpExecutionContext, config: CAMSConfig): """Fetch CAMS forecast for a given day.""" - date: dt.datetime = dt.datetime.strptime(config.date, "%Y-%m-%d") if date < dt.datetime(2015, 1, 1): diff --git a/nwp/jobs.py b/nwp/jobs.py index 88eb0b0..7edf7dd 100644 --- a/nwp/jobs.py +++ b/nwp/jobs.py @@ -1,19 +1,16 @@ import datetime as dt -from nwp.assets.cams import ( - fetch_cams_forecast_for_day, - CAMSConfig -) import json from collections.abc import Callable from typing import Any import dagster +from nwp.assets.cams import CAMSConfig, fetch_cams_forecast_for_day from nwp.assets.dwd.common import IconConfig from nwp.assets.ecmwf.mars import ( NWPConsumerConfig, nwp_consumer_convert_op, - nwp_consumer_download_op + nwp_consumer_download_op, ) jobs: list[dagster.JobDefinition] = []