@@ -28,7 +28,6 @@ def test_extract_filename_components():
2828 "data_level" : "l1a" ,
2929 "descriptor" : "burst" ,
3030 "start_date" : "20210101" ,
31- "version" : "v001.0001" ,
3231 "major_version" : 1 ,
3332 "minor_version" : 1 ,
3433 "repointing" : None ,
@@ -68,29 +67,6 @@ def test_extract_filename_components():
6867 )
6968
7069
71- # TODO remove this test after file versions are updated from vXXX to vRRR.MMM
72- def test_extract_filename_components_deprecated_version_format ():
73- """Tests the ``extract_filename_components` with old filename convention."""
74- valid_filename = "imap_mag_l1a_burst_20210101_v001.pkts"
75- # Use deprecated version format
76- expected_output = {
77- "mission" : "imap" ,
78- "instrument" : "mag" ,
79- "data_level" : "l1a" ,
80- "descriptor" : "burst" ,
81- "start_date" : "20210101" ,
82- "major_version" : None ,
83- "minor_version" : 1 ,
84- "repointing" : None ,
85- "cr" : None ,
86- "version" : "v001" ,
87- "extension" : "pkts" ,
88- }
89- assert (
90- ScienceFilePath .extract_filename_components (valid_filename ) == expected_output
91- )
92-
93-
9470def test_construct_sciencefilepathmanager ():
9571 """Tests that the ``ScienceFilePath`` class constructs a valid filename."""
9672 valid_filename = "imap_mag_l1a_burst_20210101_v001.0001.cdf"
@@ -101,41 +77,41 @@ def test_construct_sciencefilepathmanager():
10177 assert sfm .descriptor == "burst"
10278 assert sfm .start_date == "20210101"
10379 assert sfm .repointing is None
104- assert sfm .version == "v001.0001"
10580 assert sfm .major_version == 1
10681 assert sfm .minor_version == 1
10782 assert sfm .extension == "cdf"
10883
10984 # no extension
110- invalid_filename = "imap_mag_l1a_burst_20210101_v001"
85+ invalid_filename = "imap_mag_l1a_burst_20210101_v001.0001 "
11186 with pytest .raises (ScienceFilePath .InvalidImapFileError ):
11287 ScienceFilePath (invalid_filename )
11388
11489 # invalid extension
115- invalid_filename = "imap_mag_l1a_burst_20210101_v001.abc"
90+ invalid_filename = "imap_mag_l1a_burst_20210101_v001.0001. abc"
11691 with pytest .raises (ScienceFilePath .InvalidImapFileError ):
11792 ScienceFilePath (invalid_filename )
11893
11994 # invalid instrument
120- invalid_filename = "imap_sdc_l1a_burst_20210101_v001.cdf"
95+ invalid_filename = "imap_sdc_l1a_burst_20210101_v001.0001. cdf"
12196 with pytest .raises (ScienceFilePath .InvalidImapFileError ):
12297 ScienceFilePath (invalid_filename )
12398
12499 # Bad repointing, not 5 digits
125- invalid_filename = "imap_mag_l1a_burst_20210101-repoint0001_v001.cdf"
100+ invalid_filename = "imap_mag_l1a_burst_20210101-repoint0001_v001.0001. cdf"
126101 with pytest .raises (ScienceFilePath .InvalidImapFileError ):
127102 ScienceFilePath (invalid_filename )
128103
129104 # good path with an extra "test" directory
130- valid_filepath = Path ("/test/imap_mag_l1a_burst_20210101_v001.cdf" )
105+ valid_filepath = Path ("/test/imap_mag_l1a_burst_20210101_v001.0001. cdf" )
131106 sfm = ScienceFilePath (valid_filepath )
132107
133108 assert sfm .instrument == "mag"
134109 assert sfm .data_level == "l1a"
135110 assert sfm .descriptor == "burst"
136111 assert sfm .start_date == "20210101"
137112 assert sfm .repointing is None
138- assert sfm .version == "v001"
113+ assert sfm .major_version == 1
114+ assert sfm .minor_version == 1
139115 assert sfm .extension == "cdf"
140116
141117 # Test valid date for given start_date
@@ -160,10 +136,10 @@ def test_is_valid_date():
160136
161137def test_construct_upload_path ():
162138 """Tests the ``construct_path`` method."""
163- valid_filename = "imap_mag_l1a_burst_20210101_v001.cdf"
139+ valid_filename = "imap_mag_l1a_burst_20210101_v001.0001. cdf"
164140 sfm = ScienceFilePath (valid_filename )
165141 expected_output = imap_data_access .config ["DATA_DIR" ] / Path (
166- "imap/mag/l1a/2021/01/imap_mag_l1a_burst_20210101_v001.cdf"
142+ "imap/mag/l1a/2021/01/imap_mag_l1a_burst_20210101_v001.0001. cdf"
167143 )
168144
169145 assert sfm .construct_path () == expected_output
@@ -182,7 +158,8 @@ def test_generate_from_inputs():
182158 assert sfm .descriptor == "burst"
183159 assert sfm .start_date == "20210101"
184160 assert sfm .repointing is None
185- assert sfm .version == "v000.0001"
161+ assert sfm .major_version == 0
162+ assert sfm .minor_version == 1
186163 assert sfm .extension == "cdf"
187164
188165 sfm = ScienceFilePath .generate_from_inputs ("mag" , "l0" , "raw" , "20210101" , 0 , 1 )
@@ -664,7 +641,7 @@ def test_quicklook_file_path():
664641 assert file_all_params .construct_path () == expected_output
665642
666643 # Test by passing the file
667- file = QuicklookFilePath ("imap_mag_l1a_test_20210101_v001.png" )
644+ file = QuicklookFilePath ("imap_mag_l1a_test_20210101_v001.0001. png" )
668645 assert file .instrument == "mag"
669646 assert file .start_date == "20210101"
670647
@@ -726,7 +703,7 @@ def test_dependency_file_path():
726703 assert file_all_params .construct_path () == expected_output
727704
728705 # Test by passing the file
729- file = DependencyFilePath ("imap_mag_l1a_test_20210101_v001 .json" )
706+ file = DependencyFilePath ("imap_mag_l1a_test_20210101_v000.0001 .json" )
730707 assert file .instrument == "mag"
731708 assert file .start_date == "20210101"
732709
0 commit comments