Skip to content

Commit 8cb0d4e

Browse files
committed
Fix imports and paths for tests
1 parent 36d3221 commit 8cb0d4e

File tree

9 files changed

+14
-13
lines changed

9 files changed

+14
-13
lines changed

airpy/metric_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import numpy as np
66
import copy
7-
from landcover_constants import MODIS_LC, FIRE_LC
7+
from .landcover_constants import MODIS_LC, FIRE_LC
88

99
class MetricUtils():
1010
def __init__(self, img_arr):

airpy/processor_modules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Module for processing GEE datasets
33
"""
44

5-
from metric_utils import MetricUtils
5+
from .metric_utils import MetricUtils
66
import numpy as np
77
import ee
8-
from landcover_constants import MODIS_LC, FIRE_LC
8+
from .landcover_constants import MODIS_LC, FIRE_LC
99

1010

1111
class ProcessorModules():

airpy/run_airpy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from retry import retry
1010
import logging
1111
import time
12-
from utils import Utils
13-
from processor_modules import ProcessorModules
14-
from generate_config import GenerateConfig
12+
from .utils import Utils
13+
from .processor_modules import ProcessorModules
14+
from .generate_config import GenerateConfig
1515
import datetime
1616

1717

airpy/tests/__init__.py

Whitespace-only changes.

airpy/tests/test_generate_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Test functions in generate_config
33
"""
44
import pytest
5-
from generate_config import GenerateConfig
5+
from airpy.generate_config import GenerateConfig
66

77

88
class TestGenerateConfig():

airpy/tests/test_metric_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Test functions in metric utils
33
"""
4-
import metric_utils as mu
4+
import airpy.metric_utils as mu
55
import numpy as np
66

77
test_array = np.array([[3,3,5], [160, 160, 3]])

airpy/tests/test_processor_modules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
22
Test functions in processor_modules
33
"""
4-
from processor_modules import ProcessorModules
5-
from utils import Utils
4+
from airpy.processor_modules import ProcessorModules
5+
from airpy.utils import Utils
66
import xarray as xr
77
import ee
88

airpy/tests/test_run_airpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Test run_airpy pipeline
33
"""
4-
from run_airpy import *
4+
from airpy.run_airpy import *
55
import xarray as xr
66
import json
77

airpy/tests/test_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
Test functions in utils
33
"""
44

5-
from utils import Utils
5+
from pathlib import Path
6+
from airpy.utils import Utils
67
import json
78
import ee
89
import numpy as np
@@ -13,7 +14,7 @@
1314
# Defining some constants
1415
config_file = 'test_config.json'
1516

16-
with open('../airpy/tests/{}'.format(config_file), 'r') as file:
17+
with (Path(__file__).parent / config_file).open() as file:
1718
config_data = json.load(file)
1819
utils = Utils(config_data)
1920

0 commit comments

Comments
 (0)