• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dbekaert / RAiDER / 4f753398-e5bc-44cd-96d0-6e7eb936a270

29 Jun 2025 03:46AM UTC coverage: 94.756% (+0.5%) from 94.207%
4f753398-e5bc-44cd-96d0-6e7eb936a270

Pull #745

circleci

garlic-os
Update CHANGELOG.md for #745
Pull Request #745: Run tests in parallel, use temp directories for all test artifacts

425 of 516 new or added lines in 24 files covered. (82.36%)

2 existing lines in 2 files now uncovered.

3198 of 3375 relevant lines covered (94.76%)

0.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.43
/test/conftest.py
1
from pathlib import Path
1✔
2
from typing import Callable
1✔
3

4
import pytest
1✔
5

6
test_dir = Path(__file__).parents[0]
1✔
7
TEST_DIR = test_dir.resolve()
1✔
8

9

10
def pytest_addoption(parser):
1✔
11
    parser.addoption(
1✔
12
        "--skip-isce3", action="store_true", default=False, help="skip tests which require ISCE3"
13
    )
14

15

16
def pytest_configure(config):
1✔
17
    config.addinivalue_line("markers", "isce3: mark test as requiring ISCE3 to run")
1✔
18

19

20
def pytest_collection_modifyitems(config, items):
1✔
21
    if config.getoption("--skip-isce3"):
1✔
22
        skip_isce3 = pytest.mark.skip(reason="--skip-isce3 option given")
×
23
        for item in items:
×
24
            if "isce3" in item.keywords:
×
25
                item.add_marker(skip_isce3)
×
26

27

28
@pytest.fixture(scope='session')
1✔
29
def test_dir_path() -> Path:
1✔
UNCOV
30
    return TEST_DIR
×
31

32

33
@pytest.fixture(scope='session')
1✔
34
def test_gunw_path_factory() -> Callable:
1✔
35
    def factory(location: str = 'california-t71') -> Path:
1✔
36
        if location == 'california-t71':
1✔
37
            file_name = 'S1-GUNW-D-R-071-tops-20200130_20200124-135156-34956N_32979N-PP-913f-v2_0_4.nc'
1✔
38
        elif location == 'alaska':
1✔
39
            file_name = 'S1-GUNW-D-R-059-tops-20230320_20220418-180300-00179W_00051N-PP-c92e-v2_0_6.nc'
1✔
40
        elif location == 'philippines':
1✔
41
            file_name = 'S1-GUNW-D-R-032-tops-20200220_20200214-214625-00120E_00014N-PP-b785-v3_0_1.nc'
1✔
42
        else:
43
            raise NotImplementedError
×
44
        return TEST_DIR / 'gunw_test_data' / file_name
1✔
45
    return factory
1✔
46

47

48
@pytest.fixture(scope='session')
1✔
49
def test_gunw_json_path() -> Path:
1✔
50
    p = TEST_DIR / 'gunw_test_data' / 'S1-GUNW-A-R-064-tops-20210723_20210711-015001-35393N_33512N-PP-6267-v2_0_4.json'
1✔
51
    return p
1✔
52

53

54
@pytest.fixture(scope='session')
1✔
55
def test_gunw_json_schema_path() -> Path:
1✔
56
    return TEST_DIR / 'gunw_test_data' / 'gunw_schema.json'
1✔
57

58

59
@pytest.fixture(scope='session')
1✔
60
def gunw_azimuth_test():
1✔
61
    test_data = TEST_DIR / 'gunw_azimuth_test_data'
1✔
62
    return test_data / 'S1-GUNW-A-R-064-tops-20210723_20210711-015000-00119W_00033N-PP-6267-v2_0_6.nc'
1✔
63

64

65
@pytest.fixture(scope='session')
1✔
66
def orbit_dict_for_azimuth_time_test():
1✔
67
    test_data = TEST_DIR / 'gunw_azimuth_test_data'
1✔
68
    return {'reference': test_data / 'S1B_OPER_AUX_POEORB_OPOD_20210812T111941_V20210722T225942_20210724T005942.EOF',
1✔
69
            'secondary': test_data / 'S1B_OPER_AUX_POEORB_OPOD_20210731T111940_V20210710T225942_20210712T005942.EOF'}
70

71

72
@pytest.fixture(scope='session')
1✔
73
def slc_id_dict_for_azimuth_time_test():
1✔
74
    test_data = TEST_DIR / 'gunw_azimuth_test_data'
1✔
75
    return {'reference': [test_data / 'S1B_IW_SLC__1SDV_20210723T014947_20210723T015014_027915_0354B4_B3A9'],
1✔
76
            'secondary': [test_data / 'S1B_IW_SLC__1SDV_20210711T014922_20210711T014949_027740_034F80_859D',
77
                          test_data / 'S1B_IW_SLC__1SDV_20210711T015011_20210711T015038_027740_034F80_376C']}
78

79

80
@pytest.fixture(scope='session')
1✔
81
def weather_model_dict_for_azimuth_time_test():
1✔
82
    """The order is important; will be closest to InSAR acq time so goes 2, 1, 3 AM."""
83
    test_data = TEST_DIR / 'gunw_azimuth_test_data' / 'weather_files'
1✔
84
    return {'HRRR': [test_data / 'HRRR_2021_07_23_T02_00_00_33N_36N_120W_115W.nc',
1✔
85
                     test_data / 'HRRR_2021_07_23_T01_00_00_33N_36N_120W_115W.nc',
86
                     test_data / 'HRRR_2021_07_11_T02_00_00_33N_36N_120W_115W.nc',
87
                     test_data / 'HRRR_2021_07_11_T01_00_00_33N_36N_120W_115W.nc',
88
                     ]}
89

90

91
@pytest.fixture(scope='session')
1✔
92
def weather_model_dict_for_center_time_test():
1✔
93
    """Order is important here; will be in chronological order with respect to closest date times"""
94
    test_data = TEST_DIR / 'gunw_azimuth_test_data' / 'weather_files'
1✔
95
    return {'HRRR': [test_data / 'HRRR_2021_07_23_T01_00_00_33N_36N_120W_115W.nc',
1✔
96
                     test_data / 'HRRR_2021_07_23_T02_00_00_33N_36N_120W_115W.nc',
97
                     test_data / 'HRRR_2021_07_11_T01_00_00_33N_36N_120W_115W.nc',
98
                     test_data / 'HRRR_2021_07_11_T02_00_00_33N_36N_120W_115W.nc',
99
                     ]
100
            }
101

102

103
@pytest.fixture(scope='session')
1✔
104
def orbit_paths_for_duplicate_orbit_xml_test():
1✔
105
    test_data = TEST_DIR / 'data_for_overlapping_orbits'
1✔
106
    orbit_file_names = ['S1A_OPER_AUX_POEORB_OPOD_20230413T080643_V20230323T225942_20230325T005942.EOF',
1✔
107
                        'S1A_OPER_AUX_POEORB_OPOD_20230413T080643_V20230323T225942_20230325T005942.EOF',
108
                        'S1A_OPER_AUX_POEORB_OPOD_20230413T080643_V20230323T225942_20230325T005942.EOF',
109
                        'S1A_OPER_AUX_POEORB_OPOD_20230412T080821_V20230322T225942_20230324T005942.EOF']
110
    return [test_data / fn for fn in orbit_file_names]
1✔
111

112

113
@pytest.fixture(scope='session')
1✔
114
def weather_model_dict_for_gunw_integration_test():
1✔
115
    """Order is important here; will be in chronological order with respect to closest date times.
116

117
    Generate via:
118
    ```
119
    from RAiDER.processWM import prepareWeatherModel
120
    from RAiDER.models import GMAO
121
    import datetime
122

123
    model = GMAO()
124
    datetimes = [datetime.datetime(2020, 1, 30, 12, 0),
125
                 datetime.datetime(2020, 1, 30, 15, 0),
126
                 datetime.datetime(2020, 1, 24, 12, 0),
127
                 datetime.datetime(2020, 1, 24, 15, 0)]
128
    bounds = [32.5, 35.5, -119.8, -115.7]
129
    wmfiles = [prepareWeatherModel(model, dt, bounds) for dt in datetimes]
130
    ```
131
    """
132
    test_data = TEST_DIR / 'gunw_test_data' / 'weather_files'
1✔
133
    return {'GMAO': [test_data / 'GMAO_2020_01_30_T12_00_00_32N_36N_121W_114W.nc',
1✔
134
                     test_data / 'GMAO_2020_01_30_T15_00_00_32N_36N_121W_114W.nc',
135
                     test_data / 'GMAO_2020_01_24_T12_00_00_32N_36N_121W_114W.nc',
136
                     test_data / 'GMAO_2020_01_24_T15_00_00_32N_36N_121W_114W.nc']
137
           }
138

139
@pytest.fixture(scope='session')
1✔
140
def data_for_hrrr_ztd():
1✔
141
    '''Obtained via:
142
    ```
143
    from RAiDER.processWM import prepareWeatherModel
144
    from RAiDER.models import HRRR
145
    import datetime
146

147
    model = HRRR()
148
    datetimes = [datetime.datetime(2020, 1, 1, 12)]
149
    bounds = [36, 37, -92, -91]
150
    wmfiles = [prepareWeatherModel(model, dt, bounds) for dt in datetimes]
151
    ```
152
    '''
153
    test_data_dir = TEST_DIR / 'scenario_1' / 'HRRR_ztd_test'
1✔
154
    return test_data_dir / 'HRRR_2020_01_01_T12_00_00_35N_38N_93W_90W.nc'
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc