from pathlib import Path from typing import Dict, Optional, Union import shutil import pandas as pd from sokort._logging import get_logger from sokort._util import ( get_work_dir, get_data_path ) from sokort.config import Config from sokort.systems.grapes_gfs_gmf._plotter import SystemNclPlotter from sokort._plotter import PythonPlotter logger = get_logger("grapes_gfs_gmf") class TyphoonPlotter(SystemNclPlotter): """ Plotter for component typhoon. """ def __init__(self, task: Dict, work_dir: str, config: Dict, **kwargs): SystemNclPlotter.__init__(self, task, work_dir, config, **kwargs) self.typhoon_area = task["typhoon_area"] @classmethod def create_plotter( cls, graphics_config: Config, start_time: Union[datetime.datetime, pd.Timestamp],
from pathlib import Path from typing import Optional, Union, Dict import os import datetime import uuid import yaml from sokort._logging import get_logger logger = get_logger() CONFIG_ENVIRONMENT_VARIABLE_NAME = "NWPC_GRAPHICS_CONFIG" PLOT_ENGINE = ["ncl", "python"] class Config(dict): def __init__(self, config_file_path: Path = None, **kwargs): super(Config).__init__(**kwargs) self["config"] = dict() self["systems"] = dict() for engine in PLOT_ENGINE: self[engine] = dict() self.config_file_path = config_file_path @classmethod def load(cls, config_file: Union[str, Path]): config = Config(config_file_path=Path(config_file)) config._load_config() config._load_systems() return config
from pathlib import Path from typing import Dict, Union, Optional import os import shutil import datetime import pandas as pd from sokort._plotter import NclPlotter from sokort.config import Config from sokort._logging import get_logger from sokort._util import (get_work_dir, get_data_path) logger = get_logger("grapes_meso_3km") class SystemPlotter(NclPlotter): """ System plotter for GRAPES MESO 3KM """ plot_types = None system_name = "grapes_meso_3km" def __init__(self, task: Dict, work_dir: str, config: Dict, verbose: Union[bool, int] = False): """ Parameters ----------
from pathlib import Path from typing import Dict, Union, Optional import os import shutil import datetime import pandas as pd from sokort._plotter import NclPlotter from sokort.config import Config from sokort._logging import get_logger from sokort._util import (get_work_dir, get_data_path) logger = get_logger("grapes_tym") class SystemPlotter(NclPlotter): """ System plotter for GRAPES TYM """ plot_types = None system_name = "grapes_tym" def __init__(self, task: Dict, work_dir: str, config: Dict, verbose: Union[bool, int] = False): """ Parameters ----------