Skip to content

Commit e7c1a5a

Browse files
authored
cleaning up imports in data processing scripts (#41)
1 parent 0cafb6a commit e7c1a5a

7 files changed

Lines changed: 2 additions & 36 deletions

data_process/annotate_dataset.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import os
1717
from typing import List, Optional
1818
import json
19-
import time
20-
import pickle
2119
import numpy as np
2220
import h5py as h5
2321
import datetime as dt

data_process/convert_makani_output_to_wb2.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
from typing import Optional, List
1717
import progressbar
1818
import os
19-
import re
20-
import json
2119
import time
22-
import pickle
2320
import numpy as np
2421
import h5py as h5
2522
import datetime as dt
@@ -31,7 +28,6 @@
3128
# MPI
3229
from mpi4py import MPI
3330

34-
from makani.utils.features import get_channel_groups
3531
from makani.utils.dataloaders.data_helpers import get_date_from_timestamp
3632

3733
from wb2_helpers import surface_variables, atmospheric_variables, split_convert_channel_names

data_process/convert_wb2_to_makani_input.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,17 @@
1515

1616
from typing import Optional, List
1717
from itertools import batched
18-
import progressbar
1918
import os
20-
import re
2119
import json
2220
import time
23-
import pickle
2421
import numpy as np
2522
import h5py as h5
2623
import datetime as dt
2724
import argparse as ap
28-
from glob import glob
2925
import xarray as xr
3026

3127
# MPI
3228
from mpi4py import MPI
33-
from mpi4py.util import dtlib
34-
35-
from makani.utils.features import get_channel_groups
36-
from makani.utils.dataloaders.data_helpers import get_date_from_timestamp
3729

3830
from wb2_helpers import surface_variables, atmospheric_variables, split_convert_channel_names, DistributedProgressBar
3931

data_process/generate_wb2_climatology.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
from typings import Optional
17-
import re
16+
from typing import Optional
1817
import argparse as ap
1918
import xarray as xr
2019
import h5py as h5
@@ -25,8 +24,6 @@
2524

2625
from mpi4py import MPI
2726

28-
from makani.utils.dataloaders.data_helpers import get_timestamp
29-
from makani.utils.features import get_channel_groups
3027
from wb2_helpers import split_convert_channel_names
3128

3229

data_process/get_histograms.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@
2020
import pickle
2121
import numpy as np
2222
import h5py as h5
23-
from math import ceil
2423
import argparse as ap
25-
from itertools import groupby, accumulate
24+
from itertools import accumulate
2625
import operator
2726
from bisect import bisect_right
2827
from tqdm import tqdm
@@ -36,7 +35,6 @@
3635

3736
# we need that for quadrature
3837
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
39-
import torch
4038
from makani.utils.grids import GridQuadrature
4139

4240

data_process/h5_convert.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
import os
1717
from typing import Optional
18-
import sys
19-
import shutil
2018
import glob
2119
import argparse as ap
2220
import h5py as h5

data_process/merge_wb2_dataset.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,14 @@
1616
from typing import Optional, List
1717
from itertools import batched
1818
import progressbar
19-
import os
20-
import re
21-
import json
2219
import time
23-
import pickle
24-
import numpy as np
2520
import h5py as h5
2621
import datetime as dt
2722
import argparse as ap
28-
from glob import glob
29-
import xarray as xr
3023

3124
# MPI
3225
from mpi4py import MPI
3326

34-
from makani.utils.features import get_channel_groups
35-
from makani.utils.dataloaders.data_helpers import get_date_from_timestamp
36-
37-
from wb2_helpers import surface_variables, atmospheric_variables, split_convert_channel_names
38-
39-
4027
def transfer_channels(input_file: str, output_file: str, channels: List[str],
4128
batch_size: Optional[int]=32, entry_key: Optional[str]='fields',
4229
verbose: Optional[bool]=False):

0 commit comments

Comments
 (0)