Skip to content

Commit

Permalink
Manually run isort
Browse files Browse the repository at this point in the history
This doesn't seem to be getting run as part of `ruff`'s pre-commit config...
  • Loading branch information
trey-stafford committed Oct 17, 2023
1 parent 6a3e45e commit 0b2ead2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 25 deletions.
13 changes: 5 additions & 8 deletions seaice_ecdr/cdr_alg.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,23 @@
import click
import numpy as np
import numpy.typing as npt
import xarray as xr
from loguru import logger
from pm_tb_data.fetch.au_si import AU_SI_RESOLUTIONS, get_au_si_tbs

import pm_icecon.bt.compute_bt_ic as bt
import pm_icecon.bt.params.ausi_amsr2 as bt_amsr2_params
import pm_icecon.nt.compute_nt_ic as nt
import pm_icecon.nt.params.amsr2 as nt_amsr2_params
import xarray as xr
from loguru import logger
from pm_icecon._types import Hemisphere
from pm_icecon.cli.util import datetime_to_date
from pm_icecon.config.models.bt import BootstrapParams
from pm_icecon.constants import DEFAULT_FLAG_VALUES
from pm_icecon.fill_polehole import fill_pole_hole
from pm_icecon.interpolation import spatial_interp_tbs
from pm_icecon.land_spillover import (
apply_nt2_land_spillover,
)
from pm_icecon.land_spillover import apply_nt2_land_spillover
from pm_icecon.nt._types import NasateamGradientRatioThresholds
from pm_icecon.nt.tiepoints import NasateamTiePoints
from pm_icecon.util import date_range, standard_output_filename
from pm_icecon.constants import DEFAULT_FLAG_VALUES
from pm_tb_data.fetch.au_si import AU_SI_RESOLUTIONS, get_au_si_tbs

from seaice_ecdr.constants import CDR_DATA_DIR
from seaice_ecdr.land_spillover import load_or_create_land90_conc, read_adj123_file
Expand Down
2 changes: 1 addition & 1 deletion seaice_ecdr/cli/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from pm_icecon.bt.cli import cli as bt_cli
from pm_icecon.nt.cli import cli as nt_cli

from seaice_ecdr.initial_daily_ecdr import cli as ecdr_cli
from seaice_ecdr.cdr_alg import cli as cdr_cli
from seaice_ecdr.initial_daily_ecdr import cli as ecdr_cli


@click.group()
Expand Down
7 changes: 3 additions & 4 deletions seaice_ecdr/compare/ref_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@

import pandas as pd
import xarray as xr
from pm_icecon._types import Hemisphere
from pm_icecon.constants import DEFAULT_FLAG_VALUES
from pm_icecon.util import date_range, get_ps12_grid_shape, get_ps25_grid_shape
from pm_tb_data.fetch import au_si
from pyresample import AreaDefinition
from pyresample.image import ImageContainerNearest
from seaice.data.api import concentration_daily
from seaice.nasateam import NORTH, SOUTH

from pm_icecon._types import Hemisphere
from pm_icecon.constants import DEFAULT_FLAG_VALUES
from pm_icecon.util import date_range, get_ps12_grid_shape, get_ps25_grid_shape


def _get_area_def(*, hemisphere: Hemisphere, shape: tuple[int, int]) -> AreaDefinition:
proj_id = {
Expand Down
4 changes: 2 additions & 2 deletions seaice_ecdr/compare/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import pandas as pd
import xarray as xr
from loguru import logger
from pm_tb_data.fetch.au_si import AU_SI_RESOLUTIONS
from pm_icecon._types import Hemisphere
from pm_icecon.util import date_range, standard_output_filename
from pm_tb_data.fetch.au_si import AU_SI_RESOLUTIONS

from seaice_ecdr.constants import CDR_DATA_DIR
from seaice_ecdr.compare.ref_data import cdr_for_date_range
from seaice_ecdr.constants import CDR_DATA_DIR

OUTPUT_DIR = Path("/tmp/compare_cdr/")
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
Expand Down
10 changes: 5 additions & 5 deletions seaice_ecdr/compare/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
import cartopy.crs as ccrs
import numpy as np
import numpy.typing as npt
import pm_icecon.nt.api as nt_api
import xarray as xr
from matplotlib import pyplot as plt
from pm_tb_data.fetch import au_si

import pm_icecon.nt.api as nt_api
from pm_icecon._types import Hemisphere
from pm_icecon.bt.api import amsr2_goddard_bootstrap
from pm_icecon.bt.masks import get_ps_invalid_ice_mask
from seaice_ecdr.cdr_alg import amsr2_cdr
from seaice_ecdr.compare.ref_data import get_au_si_bt_conc, get_cdr, get_sea_ice_index
from pm_icecon.masks import get_ps_pole_hole_mask
from pm_icecon.nt.masks import get_ps25_sst_mask
from pm_icecon.tests.regression import test_nt
from pm_tb_data.fetch import au_si

from seaice_ecdr.cdr_alg import amsr2_cdr
from seaice_ecdr.compare.ref_data import get_au_si_bt_conc, get_cdr, get_sea_ice_index

OUTPUT_DIR = Path("/tmp/diffs/")
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
Expand Down
4 changes: 1 addition & 3 deletions seaice_ecdr/initial_daily_ecdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
from pm_icecon.constants import DEFAULT_FLAG_VALUES
from pm_icecon.fill_polehole import fill_pole_hole
from pm_icecon.interpolation import spatial_interp_tbs
from pm_icecon.land_spillover import (
apply_nt2_land_spillover,
)
from pm_icecon.land_spillover import apply_nt2_land_spillover
from pm_icecon.nt._types import NasateamGradientRatioThresholds
from pm_icecon.nt.tiepoints import NasateamTiePoints
from pm_icecon.util import date_range, standard_output_filename
Expand Down
1 change: 0 additions & 1 deletion seaice_ecdr/land_spillover.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np
from loguru import logger

from pm_icecon.land_spillover import create_land90

# TODO: The various directory vars, eg anc_dir, should be either abstracted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from loguru import logger
from numpy.testing import assert_equal

from seaice_ecdr.cdr_alg import amsr2_cdr as pmi_amsr2_cdr
from seaice_ecdr.initial_daily_ecdr import (
compute_initial_daily_ecdr_dataset as compute_idecdr_ds,
)
from seaice_ecdr.cdr_alg import amsr2_cdr as pmi_amsr2_cdr

# Set the default minimum log notification to Warning
logger.remove(0) # Removes previous logger info
Expand Down

0 comments on commit 0b2ead2

Please sign in to comment.