def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ ssh: file template: "ssh_{:y%Ym%md%d}.nc" rivers: file templates: b201702: "R201702DFraCElse_{:y%Ym%md%d}.nc" turbidity: file template: "riverTurbDaily2_{:y%Ym%md%d}.nc" run: enabled hosts: arbutus.cloud: run prep dir: runs/ forcing: ssh dir: sshNeahBay/ rivers dir: rivers/ Fraser turbidity dir: rivers/river_turb/ salish-nowcast: run prep dir: runs/ forcing: ssh dir: sshNeahBay/ rivers dir: rivers/ Fraser turbidity dir: rivers/river_turb/ """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( """ vhfr fvcom runs: fvcom grid: utm zone: 10 x2: grid file: vhfr_x2_grd.dat r12: grid file: vhfr_r12_grd.dat atmospheric forcing: hrdps grib dir: forcing/atmospheric/GEM2.5/GRIB/ fvcom atmos dir: forcing/atmospheric/GEM2.5/vhfr-fvcom atmos file template: 'atmos_{model_config}_{run_type}_{field_type}_{yyyymmdd}.nc' fvcom grid dir: nowcast-sys/FVCOM-VHFR-config/grid/ field types: - hfx - precip - wnd """ ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ file group: allen vhfr fvcom runs: host: arbutus.cloud run types: nowcast x2: results: /nemoShare/MEOPAR/SalishSea/fvcom-nowcast-x2/ forecast x2: results: /nemoShare/MEOPAR/SalishSea/fvcom-forecast-x2/ nowcast r12: results: /nemoShare/MEOPAR/SalishSea/fvcom-nowcast-r12/ results archive: nowcast x2: /opp/fvcom/nowcast-x2/ forecast x2: /opp/fvcom/forecast-x2/ nowcast r12: /opp/fvcom/nowcast-r12/ """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config, tmp_path): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" run_prep_dir = tmp_path / "wwatch3-runs" run_prep_dir.mkdir() nowcast_results_dir = tmp_path / "wwatch3-nowcast" nowcast_results_dir.mkdir() forecast_results_dir = tmp_path / "wwatch3-forecast" forecast_results_dir.mkdir() config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( f"""\ wave forecasts: run prep dir: {run_prep_dir} wwatch3 exe path: wwatch3-5.16/exe salishsea cmd: salishsea results: nowcast: {nowcast_results_dir} forecast: {forecast_results_dir} forecast2: wwatch3-forecast2/ """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( """\ file group: sallen ssh: download: tar file template: 'etss.{yyyymmdd}.t{forecast}z.csv_tar' coordinates: /SalishSeaCast/grid/coordinates_seagrid_SalishSea2.nc tidal predictions: /SalishSeaCast/SalishSeaNowcast/tidal_predictions/ neah bay hourly: Neah Bay Hourly_tidal_prediction_30-Dec-2006_31-Dec-2030.csv ssh dir: /results/forcing/sshNeahBay/ file template: 'ssh_{:y%Ym%md%d}.nc' monitoring image: /results/nowcast-sys/figures/monitoring/NBssh.png results archive: nowcast: /results/SalishSea/nowcast-blue.201905/ forecast2: /results/SalishSea/forecast2.201905/ """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ file group: allen run types: nowcast: mesh mask: mesh_mask201702.nc forecast: mesh mask: mesh_mask201702.nc forecast2: mesh mask: mesh_mask201702.nc results archive: nowcast: nowcast-blue/ forecast: forecast/ forecast2: forecast2/ figures: grid dir: nowcast-sys/grid/ """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ run types: nowcast: mesh mask: mesh_mask201702.nc run: enabled hosts: arbutus.cloud: run types: nowcast: results: /nemoShare/MEOPAR/SalishSea/nowcast/ wave forecasts: run prep dir: /nemoShare/MEOPAR/nowcast-sys/wwatch3-runs grid dir: grid/ current file template: 'SoG_current_{yyyymmdd}.nc' NEMO file template: 'SalishSea_1h_{s_yyyymmdd}_{e_yyyymmdd}_grid_{grid}.nc' """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write(""" results archive: nowcast: results/nowcast-blue/ forecast: results/forecast/ forecast2: results/forecast2/ rolling forecasts: days from past: 5 temporary results archives: /tmp/ fvcom: most recent forecast dir: opp/fvcom/most_recent_forecast nemo: dest dir: rolling-forecasts/nemo/ wwatch3: dest dir: rolling-forecasts/wwatch3/ most recent forecast dir: opp/wwatch3/most_recent_forecast wave forecasts: results archive: nowcast: opp/wwatch3/nowcast/ forecast: opp/wwatch3/forecast/ forecast2: opp/wwatch3/forecast2/ vhfr fvcom runs: results archive: nowcast x2: opp/fvcom/nowcast x2/ forecast x2: opp/fvcom/forecast x2/ """) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ ssh: tidal predictions: tidal_predictions/ results archive: forecast: /results/SalishSea/forecast/ figures: storage path: /results/nowcast-sys/figures/ storm surge info portal path: storm-surge/ storm surge feeds: storage path: atom domain: salishsea.eos.ubc.ca feed entry template: storm_surge_advisory.mako feeds: pmv.xml: title: SalishSeaCast for Port Metro Vancouver city: Vancouver tide gauge stn: Point Atkinson tidal predictions: Point Atkinson_tidal_prediction_01-Jan-2013_31-Dec-2020.csv """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write(""" vhfr fvcom runs: fvcom grid: grid dir: FVCOM-VHFR-config/grid/ x2: fraser nodes file: vh_x2_river_nodes_fraser.txt r12: fraser nodes file: vh_r12_river_nodes_fraser.txt nemo coupling: nemo coordinates: grid/coordinates_seagrid_SalishSea201702.nc rivers forcing: nemo rivers dir: rivers/ runoff file template: R201702DFraCElse_{yyyymmdd}.nc temperature climatology: rivers-climatology/rivers_ConsTemp_month.nc rivers file template: 'rivers_{model_config}_{run_type}_{yyyymmdd}.nc' input dir: x2: fvcom-runs/input.x2/ r12: fvcom-runs/input.r12/ """) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( """\ run: hindcast hosts: graham: ssh key: SalishSeaNEMO-nowcast_id_rsa queue info cmd: /opt/software/slurm/bin/squeue users: allen,dlatorne scratch dir: scratch/hindcast optimum: ssh key: SalishSeaNEMO-nowcast_id_rsa queue info cmd: /usr/bin/qstat users: sallen,dlatorne scratch dir: scratch/hindcast """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( """\ temperature salinity: bc dir: /results/forcing/LiveOcean/modified file template: 'single_LO_{:y%Ym%md%d}.nc' run: enabled hosts: arbutus.cloud-nowcast: ssh key: SalishSeaNEMO-nowcast_id_rsa forcing: bc dir: /nemoShare/MEOPAR/LiveOcean/ orcinus-nowcast-agrif: ssh key: SalishSeaNEMO-nowcast_id_rsa graham-dtn: ssh key: SalishSeaNEMO-nowcast_id_rsa optimum-hindcast: ssh key: SalishSeaNEMO-nowcast_id_rsa """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write(""" file group: allen figures: grid dir: nowcast-sys/grid/ surface current tiles: storage path: nowcast-sys/figures/surface_currents/ results archive: nowcast: results/nowcast-blue.201806/ nowcast-green: results/nowcast-green.201806/ forecast: results/forecast.201806/ forecast2: results/forecast2.201806/ run types: nowcast-green: coordinates: coordinates_seagrid_SalishSea201702.nc bathymetry: bathymetry_201702.nc mesh mask: mesh_mask201702.nc forecast: coordinates: coordinates_seagrid_SalishSea201702.nc bathymetry: bathymetry_201702.nc mesh mask: mesh_mask201702.nc forecast2: coordinates: coordinates_seagrid_SalishSea201702.nc bathymetry: bathymetry_201702.nc mesh mask: mesh_mask201702.nc """) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( """ vhfr fvcom runs: run prep dir: fvcom-runs/ fvcom grid: grid dir: FVCOM-VHFR-config/grid/ utm zone: 10 x2: grid file: vh_x2_grd.dat depths file: vh_x2_dep.dat sigma file: vh_x2_sigma.dat r12: grid file: vh_r12_grd.dat depths file: vh_r12_smp3_dep.dat sigma file: vh_r12_sigma.dat nemo coupling: coupling dir: FVCOM-VHFR-config/coupling_nemo_cut/ x2: fvcom nest indices file: vh_x2_nesting_indices.txt fvcom nest ref line file: vh_x2_nesting_innerboundary.txt r12: fvcom nest indices file: vh_r12_nesting_indices.txt fvcom nest ref line file: vh_r12_nesting_innerboundary.txt nemo cut i range: [225, 369] nemo cut j range: [340, 561] transition zone width: 8500 tanh dl: 2 tanh du: 2 nemo coordinates: grid/coordinates_seagrid_SalishSea201702.nc nemo mesh mask: grid/mesh_mask201702.nc nemo bathymetry: grid/bathymetry_201702.nc boundary file template: 'bdy_{model_config}_{run_type}_brcl_{yyyymmdd}.nc' input dir: x2: fvcom-runs/input.x2/ r12: fvcom-runs/input.r12/ run types: nowcast x2: nemo boundary results: SalishSea/nowcast/ forecast x2: nemo boundary results: SalishSea/forecast/ nowcast r12: nemo boundary results: SalishSea/nowcast/ """ ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( """\ file group: allen weather: download: 2.5 km: GRIB dir: /results/forcing/atmospheric/GEM2.5/GRIB/ url template: 'https://hpfx.collab.science.gc.ca/{date}/WXO-DD/model_hrdps/west/grib2/{forecast}/{hour}/{filename}' file template: 'CMC_hrdps_west_{variable}_ps2.5km_{date}{forecast}_P{hour}-00.grib2' grib variables: - UGRD_TGL_10 # u component of wind velocity at 10m elevation - VGRD_TGL_10 # v component of wind velocity at 10m elevation - DSWRF_SFC_0 # accumulated downward shortwave (solar) radiation at ground level - DLWRF_SFC_0 # accumulated downward longwave (thermal) radiation at ground level - LHTFL_SFC_0 # upward surface latent heat flux (for VHFR FVCOM) - TMP_TGL_2 # air temperature at 2m elevation - SPFH_TGL_2 # specific humidity at 2m elevation - RH_TGL_2 # relative humidity at 2m elevation (for VHFR FVCOM) - APCP_SFC_0 # accumulated precipitation at ground level - PRATE_SFC_0 # precipitation rate at ground level (for VHFR FVCOM) - PRMSL_MSL_0 # atmospheric pressure at mean sea level - TCDC_SFC_0 # total cloud in percent (for parametrization of radiation missing from 2007-2014 GRMLAM) forecast duration: 48 # hours 1 km: GRIB dir: /results/forcing/atmospheric/GEM1.0/GRIB/ url template: 'https://dd.alpha.meteo.gc.ca/model_hrdps/west/1km/grib2/{forecast}/{hour}/{filename}' file template: 'CMC_hrdps_west_{variable}_rotated_latlon0.009x0.009_{date}T{forecast}Z_P{hour}-00.grib2' grib variables: - UGRD_TGL_10 # u component of wind velocity at 10m elevation - VGRD_TGL_10 # v component of wind velocity at 10m elevation - DSWRF_SFC_0 # accumulated downward shortwave (solar) radiation at ground level - DLWRF_SFC_0 # accumulated downward longwave (thermal) radiation at ground level - LHTFL_SFC_0 # upward surface latent heat flux (for VHFR FVCOM) - TMP_TGL_2 # air temperature at 2m elevation - SPFH_TGL_2 # specific humidity at 2m elevation - RH_TGL_2 # relative humidity at 2m elevation (for VHFR FVCOM) - APCP_SFC_0 # accumulated precipitation at ground level - PRATE_SFC_0 # precipitation rate at ground level (for VHFR FVCOM) - PRMSL_MSL_0 # atmospheric pressure at mean sea level forecast duration: 36 # hours """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ file group: allen results archive: nowcast: SalishSea/nowcast/ forecast: SalishSea/forecast/ forecast2: SalishSea/forecast2/ nowcast-green: SalishSea/nowcast-green/ nowcast-agrif: SalishSea/nowcast-agrif/ hindcast: localhost: SalishSea/hindcast/ graham-dtn: nearline/SalishSea/hindcast/ run: enabled hosts: arbutus.cloud-nowcast: run types: nowcast: results: SalishSea/nowcast/ forecast: results: SalishSea/forecast/ forecast2: results: SalishSea/forecast2/ nowcast-green: results: SalishSea/nowcast-green/ orcinus-nowcast-agrif: run types: nowcast-agrif: results: SalishSea/nowcast-agrif/ graham-dtn: ssh key: SalishSeaNEMO-nowcast_id_rsa hindcast hosts: optimum-hindcast: run types: hindcast: results: SalishSea/hindcast sockeye-hindcast: run types: hindcast: results: SalishSea/hindcast """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ observations: hadcp data: csv dir: opp/obs/AISDATA/ dest dir: opp/obs/AISDATA/netcdf/ filepath template: 'VFPA_2ND_NARROWS_HADCP_2s_{yyyymm}.nc' """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( """\ results archive: hindcast: localhost: results/SalishSea/hindcast.201905/ """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def base_config(tmpdir): """:py:class:`nemo_nowcast.Config` instance from YAML fragment containing elements required by all unit tests. """ p = tmpdir.join("config.yaml") p.write(""" # Items required by the Config instance checklist file: nowcast_checklist.yaml python: python logging: handlers: [] """) config_ = nemo_nowcast.Config() config_.load(str(p)) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ ssh: download: url template: 'https://nomads.ncep.noaa.gov/pub/data/nccf/com/etss/prod/etss.{yyyymmdd}/etss.t{forecast}z.csv_tar' tar file template: 'etss.{yyyymmdd}.t{forecast}z.csv_tar' tarball csv file template: 'etss.{yyyymmdd}/t{forecast}z_csv/9443090.csv' ssh dir: /results/forcing/sshNeahBay/ """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ temperature salinity: download: dest dir: forcing/LiveOcean/downloaded bc dir: forcing/LiveOcean/boundary_conditions file template: 'LiveOcean_v201905_{:y%Ym%md%d}.nc' mesh mask: grid/mesh_mask201702.nc parameter set: v201905 """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ run: enabled hosts: orcinus: ssh key: SalishSeaNEMO-nowcast_id_rsa scratch dir: scratch/nowcast-agrif run prep dir: nowcast-agrif-sys/runs salishsea cmd: .local/bin/salishsea """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def prod_config(tmpdir): """:py:class:`nemo_nowcast.Config` instance from production config YAML file to use for testing its contents. """ prod_config_ = nemo_nowcast.Config() p_logs_dir = tmpdir.ensure_dir("nowcast_logs") p_env_dir = tmpdir.ensure_dir("nowcast-env") p_environ = patch.dict( nemo_nowcast.config.os.environ, { "NOWCAST_LOGS": str(p_logs_dir), "NOWCAST_ENV": str(p_env_dir) }, ) prod_config_file = (Path(__file__).parent / "../config/nowcast.yaml").resolve() with p_environ: prod_config_.load(prod_config_file) return prod_config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( """\ run: hindcast hosts: cedar: ssh key: SalishSeaNEMO-nowcast_id_rsa queue info cmd: /opt/software/slurm/bin/squeue users: allen,dlatorne scratch dir: scratch/ run prep dir: runs/ salishsea cmd: executable: bin/salishsea run options: --deflate --max-deflate-jobs 48 envvars: optimum: ssh key: SalishSeaNEMO-nowcast_id_rsa queue info cmd: /usr/bin/qstat users: sallen,dlatorne scratch dir: scratch/ run prep dir: runs/ salishsea cmd: executable: bin/salishsea run options: envvars: PATH: $PATH:$HOME/bin FORCING: /shared PROJECT: /home SUSANPROJECT: /home """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( """\ file group: allen temperature salinity: download: status file url template: 'https://liveocean.apl.uw.edu/output/f{yyyymmdd}/ubc_done.txt' bc file url template: 'https://liveocean.apl.uw.edu/output/f{yyyymmdd}/ubc.nc' file name: low_passed_UBC.nc dest dir: forcing/LiveOcean/downloaded """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ rivers: datamart dir: datamart/hydrometric/ csv file template: 'BC_{stn_id}_hourly_hydrometric.csv' stations: Capilano: 08GA010 Englishman: 08HB002 Fraser: 08MF005 SOG river files: Capilano: /opp/observations/rivers/Capilano/Caplilano_08GA010_day_avg_flow Englishman: SOG-projects/SOG-forcing/ECget/Englishman_flow Fraser: SOG-projects/SOG-forcing/ECget/Fraser_flow """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ weather: file template: 'ops_{:y%Ym%md%d}.nc' run: enabled hosts: arbutus.cloud: forcing: weather dir: /nemoShare/MEOPAR/GEM2.5/ops/NEMO-atmos/ wave forecasts: run prep dir: /nemoShare/MEOPAR/nowcast-sys/wwatch3-runs/ wind file template: 'SoG_wind_{yyyymmdd}.nc' """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent( """\ run types: nowcast: duration: 1 # day nowcast-dev: duration: 1 # day nowcast-green: duration: 1 # day forecast: duration: 1.5 # days forecast2: duration: 1.25 # days run: enabled hosts: arbutus.cloud: run types: nowcast: results: results/SalishSea/nowcast/ nowcast-green: results: results/SalishSea/nowcast-green/ nowcast-dev: results: results/SalishSea/nowcast-dev/ forecast: results: results/SalishSea/forecast/ forecast2: results: results/SalishSea/forecast2/ """ ) ) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write( textwrap.dedent("""\ erddap: flag dir: tmp_flag_dir/ datasetIDs: weather: - ubcSSaSurfaceAtmosphereFieldsV1 SCVIP-CTD: - ubcONCSCVIPCTD15mV1 SEVIP-CTD: - ubcONCSEVIPCTD15mV1 USDDL-CTD: - ubcONCUSDDLCTD15mV1 TWDP-ferry: - ubcONCTWDP1mV1 nowcast-green: - ubcSSg3DBiologyFields1hV19-05 - ubcSSg3DuGridFields1hV19-05 nemo-forecast: - ubcSSfSandyCoveSSH10m wwatch3-forecast: - ubcSSf2DWaveFields30mV17-02 VFPA-HADCP: - ubcVFPA2ndNarrowsCurrent2sV1 fvcom-x2-nowcast: - ubcSSFVCOM-VHFR-BaroclinicX2 fvcom-r12-nowcast: - ubcSSFVCOM-VHFR-BaroclinicR12 fvcom-forecast: - ubcSSFVCOM-VHFR-BaroclinicX2 """)) config_ = nemo_nowcast.Config() config_.load(config_file) return config_
def config(base_config): """:py:class:`nemo_nowcast.Config` instance from YAML fragment to use as config for unit tests.""" config_file = Path(base_config.file) with config_file.open("at") as f: f.write(""" vhfr fvcom runs: host: arbutus.cloud ssh key: SalishSeaNEMO-nowcast_id_rsa atmospheric forcing: fvcom atmos dir: forcing/atmospheric/GEM2.5/vhfr-fvcom atmos file template: 'atmos_{model_config}_{run_type}_{field_type}_{yyyymmdd}.nc' field types: - hfx - precip - wnd input dir: x2: fvcom-runs/input.x2/ r12: fvcom-runs/input.r12/ """) config_ = nemo_nowcast.Config() config_.load(config_file) return config_