From af3b6a50f377a0a7d3d846fa421e5d0015ba6cd3 Mon Sep 17 00:00:00 2001 From: Nils Date: Thu, 3 Oct 2024 11:57:15 +0200 Subject: [PATCH 01/12] Fix version number when bundling - variable version was refactored to VERSION in Main.py preventing make.py to read the version number. --- make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.py b/make.py index 3dc61e7..9dab4dd 100644 --- a/make.py +++ b/make.py @@ -39,7 +39,7 @@ version = None with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Main.py'), 'r') as f: for l in f: - if l.startswith('version'): + if l.startswith('VERSION'): version = l.split('=')[1].strip(" \n'") break From df1297bfe8b1d39e2ae29cdd4214f61bdbee8ee2 Mon Sep 17 00:00:00 2001 From: Nils Date: Thu, 3 Oct 2024 12:25:32 +0200 Subject: [PATCH 02/12] Fix Qt Windows opening in command line mode (no windows) - Any call to QtWidgets.QMessageBox() is preceded by check of environment variable `HYPERINSPACE_CMD` to ensure it's false. If in command mode and an answer was requested from the message box, then a positive answer is returned. At this point this is only for download of zhang lut. - Removed static method Utilities.waitWindow as not used. --- Source/GetAnc.py | 4 +++- Source/ProcessL2.py | 8 ++++++-- Source/Utilities.py | 16 ++++------------ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Source/GetAnc.py b/Source/GetAnc.py index 19154ea..15b2c0e 100644 --- a/Source/GetAnc.py +++ b/Source/GetAnc.py @@ -121,6 +121,8 @@ def getAnc(inputGroup): msg = f'Request error: {status}' print(msg) Utilities.writeLogFile(msg) + if os.environ["HYPERINSPACE_CMD"].lower() == 'true': + return alert = QtWidgets.QMessageBox() alert.setText(f'Request error: {status}\n \ Check that server credentials have \n \ @@ -128,7 +130,7 @@ def getAnc(inputGroup): MERRA2 model data are not available until \n \ the third week of the following month.') alert.exec_() - return None + return # GMAO Atmospheric model data node = HDFRoot.readHDF5(filePath1) diff --git a/Source/ProcessL2.py b/Source/ProcessL2.py index 751ead3..8096d4f 100644 --- a/Source/ProcessL2.py +++ b/Source/ProcessL2.py @@ -157,7 +157,9 @@ def nirCorrection(node, sensor, F0): ρ720.append(ρSlice[k][-1]) # Using current element/slice [-1] # if not ρ720: - # QtWidgets.QMessageBox.critical("Error", "NIR wavebands unavailable") + # print("Error: NIR wavebands unavailable") + # if os.environ["HYPERINSPACE_CMD"].lower() == 'false': + # QtWidgets.QMessageBox.critical("Error", "NIR wavebands unavailable") ρ1 = sp.interpolate.interp1d(x,ρ720)(720) F01 = sp.interpolate.interp1d(wavelength,F0)(720) ρ780 = [] @@ -169,7 +171,9 @@ def nirCorrection(node, sensor, F0): x.append(float(k)) ρ780.append(ρSlice[k][-1]) if not ρ780: - QtWidgets.QMessageBox.critical("Error", "NIR wavebands unavailable") + print("Error: NIR wavebands unavailable") + if os.environ["HYPERINSPACE_CMD"].lower() == 'false': + QtWidgets.QMessageBox.critical("Error", "NIR wavebands unavailable") ρ2 = sp.interpolate.interp1d(x,ρ780)(780) F02 = sp.interpolate.interp1d(wavelength,F0)(780) ρ870 = [] diff --git a/Source/Utilities.py b/Source/Utilities.py index 946cbc9..5d875dc 100644 --- a/Source/Utilities.py +++ b/Source/Utilities.py @@ -252,6 +252,8 @@ def find_nearest(array,value): @staticmethod def errorWindow(winText,errorText): + if os.environ["HYPERINSPACE_CMD"].lower() == 'true': + return msgBox = QMessageBox() # msgBox.setIcon(QMessageBox.Information) msgBox.setIcon(QMessageBox.Critical) @@ -260,20 +262,10 @@ def errorWindow(winText,errorText): msgBox.setStandardButtons(QMessageBox.Ok) msgBox.exec_() - - @staticmethod - def waitWindow(winText,waitText): - msgBox = QMessageBox() - # msgBox.setIcon(QMessageBox.Information) - msgBox.setIcon(QMessageBox.Critical) - msgBox.setText(waitText) - msgBox.setWindowTitle(winText) - # msgBox.setStandardButtons(QMessageBox.Ok) - # msgBox.exec_() - return msgBox - @staticmethod def YNWindow(winText,infoText): + if os.environ["HYPERINSPACE_CMD"].lower() == 'true': + return QMessageBox.Ok # Assume positive answer to keep processing in command line mode (no X) msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText(infoText) From d012dc58e37c5a6616ee407978aac0d5ff8c0a8e Mon Sep 17 00:00:00 2001 From: Nils Date: Wed, 16 Oct 2024 15:28:42 -0400 Subject: [PATCH 03/12] Add Seabird SolarTracker to test + minor fixes - missing column STATION in dataset STATION from group ANCILLARY raised error when running pySAS test - incorrect configuration filename in Manual TriOS test raised error when looking for calibration files --- Source/Controller.py | 7 +++++-- Tests/test_sample_data.py | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Source/Controller.py b/Source/Controller.py index 36c2f8b..480d986 100644 --- a/Source/Controller.py +++ b/Source/Controller.py @@ -694,8 +694,11 @@ def processSingleLevel(pathOut, inFilePath, calibrationMap, level, flag_Trios): ancGroup.datasets[ds].datasetToColumns() except Exception: print('Error: Something wrong with root ANCILLARY') - stations = np.array(root.getGroup("ANCILLARY").getDataset("STATION").columns["STATION"]) - stations = np.unique(stations[~np.isnan(stations)]).tolist() + if root.getGroup("ANCILLARY").getDataset("STATION") is not None: + stations = np.array(root.getGroup("ANCILLARY").getDataset("STATION").columns["STATION"]) + stations = np.unique(stations[~np.isnan(stations)]).tolist() + else: + stations = [] if len(stations) > 0: diff --git a/Tests/test_sample_data.py b/Tests/test_sample_data.py index ce5d93e..ed4e7a1 100644 --- a/Tests/test_sample_data.py +++ b/Tests/test_sample_data.py @@ -12,7 +12,7 @@ def setUp(self): # Load files to process self.path_to_data = os.path.join(root, 'Data', 'Sample_Data', 'Manual_TriOS') self.anc_filename = os.path.join(self.path_to_data, f"FICE22_TriOS_Ancillary.sb") - self.cfg_filename = os.path.join(root, "Config", "sample_TriOS_NOTRACKER.cfg") + self.cfg_filename = os.path.join(root, "Config", "sample_TRIOS_NOTRACKER.cfg") self.files = sorted(glob.glob(os.path.join(self.path_to_data, 'RAW', f'*.mlb'))) def test_manual_trios(self): @@ -38,5 +38,21 @@ def test_pysas(self): self.anc_filename, processMultiLevel=True) +class TestSeabirdSolarTracker(unittest.TestCase): + def setUp(self): + # Load files to process + self.path_to_data = os.path.join(root, 'Data', 'Sample_Data', 'SolarTracker') + self.anc_filename = os.path.join(self.path_to_data, f"KORUS_SOLARTRACKER_Ancillary.sb") + self.cfg_filename = os.path.join(root, "Config", "sample_SEABIRD_SOLARTRACKER.cfg") + self.files = sorted(glob.glob(os.path.join(self.path_to_data, 'RAW', f'*.RAW'))) + + def test_pysas(self): + from Main import Command + os.chdir(root) # Need to switch to root as path in Config files are relative + for file in self.files: + Command(self.cfg_filename, 'RAW', file, self.path_to_data,'L1A', + self.anc_filename, processMultiLevel=True) + + if __name__ == '__main__': unittest.main() From 40081cb3cb4e6ee45d48024e071b97eb059c7e57 Mon Sep 17 00:00:00 2001 From: Dirk Aurin Date: Tue, 5 Nov 2024 15:01:31 -0500 Subject: [PATCH 04/12] add creds back master --- .ecmwf_api_config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ecmwf_api_config b/.ecmwf_api_config index 2420732..85bef26 100644 --- a/.ecmwf_api_config +++ b/.ecmwf_api_config @@ -1,9 +1,9 @@ # CDS: obtain url and key at: https://cds.climate.copernicus.eu/api-how-to [cds] cds_url: https://cds.climate.copernicus.eu/api/v2 -cds_key: +cds_key: 323944:12965887-9754-415d-a480-7d019087e914 # ADS: obtain url and key at: https://ads.atmosphere.copernicus.eu/api-how-to [ads] ads_url: https://ads.atmosphere.copernicus.eu/api/v2 -ads_key: +ads_key: 20878:fb2e2880-af54-43e7-ad41-dc7204ce2f7a From 7921730aa9d5afc7780ffded0646decf66eaa173 Mon Sep 17 00:00:00 2001 From: Dirk Aurin Date: Tue, 5 Nov 2024 15:08:50 -0500 Subject: [PATCH 05/12] Remove ecmwf --- .ecmwf_api_config | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .ecmwf_api_config diff --git a/.ecmwf_api_config b/.ecmwf_api_config deleted file mode 100644 index 85bef26..0000000 --- a/.ecmwf_api_config +++ /dev/null @@ -1,9 +0,0 @@ -# CDS: obtain url and key at: https://cds.climate.copernicus.eu/api-how-to -[cds] -cds_url: https://cds.climate.copernicus.eu/api/v2 -cds_key: 323944:12965887-9754-415d-a480-7d019087e914 - -# ADS: obtain url and key at: https://ads.atmosphere.copernicus.eu/api-how-to -[ads] -ads_url: https://ads.atmosphere.copernicus.eu/api/v2 -ads_key: 20878:fb2e2880-af54-43e7-ad41-dc7204ce2f7a From 6929150a094c26a4da867d87c80f64b00c6d1534 Mon Sep 17 00:00:00 2001 From: Nils Date: Thu, 3 Oct 2024 11:57:15 +0200 Subject: [PATCH 06/12] Fix version number when bundling - variable version was refactored to VERSION in Main.py preventing make.py to read the version number. --- make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.py b/make.py index 3dc61e7..9dab4dd 100644 --- a/make.py +++ b/make.py @@ -39,7 +39,7 @@ version = None with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Main.py'), 'r') as f: for l in f: - if l.startswith('version'): + if l.startswith('VERSION'): version = l.split('=')[1].strip(" \n'") break From 74f804fb735d192b4437ad1ffc4cb657599e7d09 Mon Sep 17 00:00:00 2001 From: Nils Date: Thu, 3 Oct 2024 12:25:32 +0200 Subject: [PATCH 07/12] Fix Qt Windows opening in command line mode (no windows) - Any call to QtWidgets.QMessageBox() is preceded by check of environment variable `HYPERINSPACE_CMD` to ensure it's false. If in command mode and an answer was requested from the message box, then a positive answer is returned. At this point this is only for download of zhang lut. - Removed static method Utilities.waitWindow as not used. --- Source/GetAnc.py | 4 +++- Source/ProcessL2.py | 8 ++++++-- Source/Utilities.py | 16 ++++------------ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Source/GetAnc.py b/Source/GetAnc.py index 19154ea..15b2c0e 100644 --- a/Source/GetAnc.py +++ b/Source/GetAnc.py @@ -121,6 +121,8 @@ def getAnc(inputGroup): msg = f'Request error: {status}' print(msg) Utilities.writeLogFile(msg) + if os.environ["HYPERINSPACE_CMD"].lower() == 'true': + return alert = QtWidgets.QMessageBox() alert.setText(f'Request error: {status}\n \ Check that server credentials have \n \ @@ -128,7 +130,7 @@ def getAnc(inputGroup): MERRA2 model data are not available until \n \ the third week of the following month.') alert.exec_() - return None + return # GMAO Atmospheric model data node = HDFRoot.readHDF5(filePath1) diff --git a/Source/ProcessL2.py b/Source/ProcessL2.py index 3647436..7aedf01 100644 --- a/Source/ProcessL2.py +++ b/Source/ProcessL2.py @@ -157,7 +157,9 @@ def nirCorrection(node, sensor, F0): ρ720.append(ρSlice[k][-1]) # Using current element/slice [-1] # if not ρ720: - # QtWidgets.QMessageBox.critical("Error", "NIR wavebands unavailable") + # print("Error: NIR wavebands unavailable") + # if os.environ["HYPERINSPACE_CMD"].lower() == 'false': + # QtWidgets.QMessageBox.critical("Error", "NIR wavebands unavailable") ρ1 = sp.interpolate.interp1d(x,ρ720)(720) F01 = sp.interpolate.interp1d(wavelength,F0)(720) ρ780 = [] @@ -169,7 +171,9 @@ def nirCorrection(node, sensor, F0): x.append(float(k)) ρ780.append(ρSlice[k][-1]) if not ρ780: - QtWidgets.QMessageBox.critical("Error", "NIR wavebands unavailable") + print("Error: NIR wavebands unavailable") + if os.environ["HYPERINSPACE_CMD"].lower() == 'false': + QtWidgets.QMessageBox.critical("Error", "NIR wavebands unavailable") ρ2 = sp.interpolate.interp1d(x,ρ780)(780) F02 = sp.interpolate.interp1d(wavelength,F0)(780) ρ870 = [] diff --git a/Source/Utilities.py b/Source/Utilities.py index ec5d7a7..488797d 100644 --- a/Source/Utilities.py +++ b/Source/Utilities.py @@ -252,6 +252,8 @@ def find_nearest(array,value): @staticmethod def errorWindow(winText,errorText): + if os.environ["HYPERINSPACE_CMD"].lower() == 'true': + return msgBox = QMessageBox() # msgBox.setIcon(QMessageBox.Information) msgBox.setIcon(QMessageBox.Critical) @@ -260,20 +262,10 @@ def errorWindow(winText,errorText): msgBox.setStandardButtons(QMessageBox.Ok) msgBox.exec_() - - @staticmethod - def waitWindow(winText,waitText): - msgBox = QMessageBox() - # msgBox.setIcon(QMessageBox.Information) - msgBox.setIcon(QMessageBox.Critical) - msgBox.setText(waitText) - msgBox.setWindowTitle(winText) - # msgBox.setStandardButtons(QMessageBox.Ok) - # msgBox.exec_() - return msgBox - @staticmethod def YNWindow(winText,infoText): + if os.environ["HYPERINSPACE_CMD"].lower() == 'true': + return QMessageBox.Ok # Assume positive answer to keep processing in command line mode (no X) msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText(infoText) From 3a1fa365b7bcdc01b38c2d092cb9368ec8a87552 Mon Sep 17 00:00:00 2001 From: Nils Date: Wed, 16 Oct 2024 15:28:42 -0400 Subject: [PATCH 08/12] Add Seabird SolarTracker to test + minor fixes - missing column STATION in dataset STATION from group ANCILLARY raised error when running pySAS test - incorrect configuration filename in Manual TriOS test raised error when looking for calibration files --- Source/Controller.py | 7 +++++-- Tests/test_sample_data.py | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Source/Controller.py b/Source/Controller.py index 36c2f8b..480d986 100644 --- a/Source/Controller.py +++ b/Source/Controller.py @@ -694,8 +694,11 @@ def processSingleLevel(pathOut, inFilePath, calibrationMap, level, flag_Trios): ancGroup.datasets[ds].datasetToColumns() except Exception: print('Error: Something wrong with root ANCILLARY') - stations = np.array(root.getGroup("ANCILLARY").getDataset("STATION").columns["STATION"]) - stations = np.unique(stations[~np.isnan(stations)]).tolist() + if root.getGroup("ANCILLARY").getDataset("STATION") is not None: + stations = np.array(root.getGroup("ANCILLARY").getDataset("STATION").columns["STATION"]) + stations = np.unique(stations[~np.isnan(stations)]).tolist() + else: + stations = [] if len(stations) > 0: diff --git a/Tests/test_sample_data.py b/Tests/test_sample_data.py index ce5d93e..ed4e7a1 100644 --- a/Tests/test_sample_data.py +++ b/Tests/test_sample_data.py @@ -12,7 +12,7 @@ def setUp(self): # Load files to process self.path_to_data = os.path.join(root, 'Data', 'Sample_Data', 'Manual_TriOS') self.anc_filename = os.path.join(self.path_to_data, f"FICE22_TriOS_Ancillary.sb") - self.cfg_filename = os.path.join(root, "Config", "sample_TriOS_NOTRACKER.cfg") + self.cfg_filename = os.path.join(root, "Config", "sample_TRIOS_NOTRACKER.cfg") self.files = sorted(glob.glob(os.path.join(self.path_to_data, 'RAW', f'*.mlb'))) def test_manual_trios(self): @@ -38,5 +38,21 @@ def test_pysas(self): self.anc_filename, processMultiLevel=True) +class TestSeabirdSolarTracker(unittest.TestCase): + def setUp(self): + # Load files to process + self.path_to_data = os.path.join(root, 'Data', 'Sample_Data', 'SolarTracker') + self.anc_filename = os.path.join(self.path_to_data, f"KORUS_SOLARTRACKER_Ancillary.sb") + self.cfg_filename = os.path.join(root, "Config", "sample_SEABIRD_SOLARTRACKER.cfg") + self.files = sorted(glob.glob(os.path.join(self.path_to_data, 'RAW', f'*.RAW'))) + + def test_pysas(self): + from Main import Command + os.chdir(root) # Need to switch to root as path in Config files are relative + for file in self.files: + Command(self.cfg_filename, 'RAW', file, self.path_to_data,'L1A', + self.anc_filename, processMultiLevel=True) + + if __name__ == '__main__': unittest.main() From 00607fe2dd040e78459df62fe2148b18b0f496c2 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 19 Nov 2024 10:34:50 -0500 Subject: [PATCH 09/12] Add ECMWF and GMAO credential to GitHub Workflow for testing - Fix BaseInstrument.FRM_L2: rhoDelta needed to be resized to rho shape. - Fix getAnc_ecmwf(): wind and aod were list of np.array instead of list or np.array which caused HDFDataset.write to raise an error on either variable due to invalid dtype. - Dropped .ecmwf_api_config from make.py as not needed anymore. - Add badge to README.md --- .github/workflows/ApplicationTesting.yml | 15 +++++++++++---- README.md | 3 +++ Source/GetAnc_ecmwf.py | 6 +++--- Source/ProcessInstrumentUncertainties.py | 5 +++++ make.py | 1 - 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ApplicationTesting.yml b/.github/workflows/ApplicationTesting.yml index 66cfea7..a9e985d 100644 --- a/.github/workflows/ApplicationTesting.yml +++ b/.github/workflows/ApplicationTesting.yml @@ -1,4 +1,4 @@ -name: ApplicationTesting +name: Application Testing on: push: @@ -29,10 +29,17 @@ jobs: - name: 🔧 Setup Environment uses: ./.github/actions/SetupEnvironment - - name: 📑 Capture Environment + - name: 🔑 Get ECMWF CDS|ADS Credentials + env: + CDSAPIRC: ${{ secrets.ECMWF_ADS_CREDENTIALS }} run: | - mamba info - mamba list + echo "$CDSAPIRC" >> ~/.ecmwf_ads_credentials.json + + - name: 🔑 Get GMAO MERRA2 Credentials + env: + NETRC: ${{ secrets.NETRC }} + run: | + echo "$NETRC" >> ~/.netrc - name: 🧪 Run Tests run: | diff --git a/README.md b/README.md index 20d6752..a1d3481 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@
Banner
+![Test](https://github.com/nasa/HyperCP/actions/workflows/ApplicationTesting.yml/badge.svg) +![Bundle](https://github.com/nasa/HyperCP/actions/workflows/Pipeline.yml/badge.svg) + Hyperspectral In situ Support for PACE (HyperInSPACE) Community Processor (HyperCP) is designed to provide hyperspectral support for the PACE mission but also multispectral missions such as [Sentinel-3](https://sentinels.copernicus.eu/web/sentinel/missions/sentinel-3) by processing automated and manual, above-water, hyperspectral ocean color radiometry data using state-of-the-art methods and protocols for quality assurance, diff --git a/Source/GetAnc_ecmwf.py b/Source/GetAnc_ecmwf.py index bc9a1c9..e6daae0 100644 --- a/Source/GetAnc_ecmwf.py +++ b/Source/GetAnc_ecmwf.py @@ -223,11 +223,11 @@ def getAnc_ecmwf(inputGroup): ancillary = GetAnc_ecmwf.get_ancillary_main(lat[index], lon[index], lat_timeStamp, ancPath) # position retrieval index has been confirmed manually in SeaDAS - uWind = ancillary['10m_u_component_of_wind']['value'] - vWind = ancillary['10m_v_component_of_wind']['value'] + uWind = ancillary['10m_u_component_of_wind']['value'][0] + vWind = ancillary['10m_v_component_of_wind']['value'][0] modWind.append(np.sqrt(uWind*uWind + vWind*vWind)) # direction not needed #ancAOD = aerGroup.getDataset("TOTEXTTAU") - modAOD.append(ancillary['total_aerosol_optical_depth_550nm']['value']) + modAOD.append(ancillary['total_aerosol_optical_depth_550nm']['value'][0]) modData = HDFRoot() modGroup = modData.addGroup('ECMWF') diff --git a/Source/ProcessInstrumentUncertainties.py b/Source/ProcessInstrumentUncertainties.py index 683164c..a3ce68c 100644 --- a/Source/ProcessInstrumentUncertainties.py +++ b/Source/ProcessInstrumentUncertainties.py @@ -376,11 +376,16 @@ def FRM_L2(self, rhoScalar: float, rhoVec: np.array, rhoDelta: np.array, waveSub xSlice['ltSample'][i].items() if float(key) in waveSubset} for i in range(len(xSlice['ltSample']))]) + # Get rho from scalar or vector if rhoScalar is not None: # make rho a constant array if scalar rho = np.ones(len(waveSubset))*rhoScalar # convert rhoScalar to the same dims as other values/Uncertainties else: rho = np.asarray(list(rhoVec.values()), dtype=float) + # Get rhoDelta from scalar or vector + if not hasattr(rhoDelta, '__len__'): # Not an array (e.g. list or np.array) + rhoDelta = np.ones(len(waveSubset)) * rhoDelta # convert rhoDelta to the same dims as other values/Uncertainties + # initialise punpy propagation object mdraws = esSampleXSlice.shape[0] # keep no. of monte carlo draws consistent Propagate_L2_FRM = Propagate(mdraws, cores=1) # punpy.MCPropagation(mdraws, parallel_cores=1) diff --git a/make.py b/make.py index 9dab4dd..c3b1848 100644 --- a/make.py +++ b/make.py @@ -62,7 +62,6 @@ linked_data = [ f'--add-data={os.path.relpath("version.txt", root)}{add_data_sep}.', f'--add-data={os.path.relpath("Config", root)}{add_data_sep}Config', - f'--add-data={os.path.relpath(".ecmwf_api_config", root)}{add_data_sep}.', ] for f in sorted(glob.glob(os.path.join('Data', '*'))): if os.path.isdir(f) and os.path.basename(f) not in ['L1A', 'L1AQC', 'L1B', 'L1BQC', 'L2', 'Plots', 'Reports']: From abd5abec7ca71e51d9f96f0dd85fb064a7f3cfe4 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 19 Nov 2024 11:39:17 -0500 Subject: [PATCH 10/12] Fix GitHub workflows - Fix version number with double quotes - Change shell on windows in setup environment --- .github/actions/SetupEnvironment/action.yml | 19 +++++++++++++++++-- .github/workflows/Build.yml | 2 +- make.py | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/actions/SetupEnvironment/action.yml b/.github/actions/SetupEnvironment/action.yml index 427f217..ab019a4 100644 --- a/.github/actions/SetupEnvironment/action.yml +++ b/.github/actions/SetupEnvironment/action.yml @@ -21,18 +21,33 @@ runs: conda-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }} env: # Increase this value to reset cache if environment.yml has not changed - CACHE_NUMBER: 0 + CACHE_NUMBER: 1 id: cache - name: 🔄 Update Environment - if: steps.cache.outputs.cache-hit != 'true' + if: runner.os != 'Windows' && steps.cache.outputs.cache-hit != 'true' shell: bash -el {0} run: | mamba env update -n hypercp -f environment.yml mamba install --channel=conda-forge pyinstaller==6.6 - name: 📸 Capture Environment + if: runner.os != 'Windows' shell: bash -el {0} run: | mamba info mamba list + + - name: 🔄 Update Environment [Windows] + if: runner.os == 'Windows' && steps.cache.outputs.cache-hit != 'true' + shell: pwsh + run: | + mamba env update -n hypercp -f environment.yml + mamba install --channel=conda-forge pyinstaller==6.6 + + - name: 📸 Capture Environment [Windows] + if: runner.os == 'Windows' + shell: pwsh + run: | + mamba info + mamba list diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 2d56625..ecad629 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -38,7 +38,7 @@ jobs: echo "BUNDLE_NAME=$(ls Bundled/dist | head -1 | xargs)" >> $GITHUB_ENV - name: 📥 Zip Bundle - uses: thedoctor0/zip-release@0.7.1 + uses: thedoctor0/zip-release@0.7 with: type: 'zip' directory: 'Bundled/dist/' diff --git a/make.py b/make.py index c3b1848..bc30ced 100644 --- a/make.py +++ b/make.py @@ -40,7 +40,7 @@ with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Main.py'), 'r') as f: for l in f: if l.startswith('VERSION'): - version = l.split('=')[1].strip(" \n'") + version = l.split('=')[1].strip(" \n'\"") break # Get git hash (without git package) From 8757493b3045c1116018a65852c99d938d595294 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 19 Nov 2024 11:41:48 -0500 Subject: [PATCH 11/12] Fix GitHub workflows --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index ecad629..31fe23a 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -38,7 +38,7 @@ jobs: echo "BUNDLE_NAME=$(ls Bundled/dist | head -1 | xargs)" >> $GITHUB_ENV - name: 📥 Zip Bundle - uses: thedoctor0/zip-release@0.7 + uses: thedoctor0/zip-release@0.7.* with: type: 'zip' directory: 'Bundled/dist/' From 8006b78d9244ef62168f4bb65bd32d6d3105d730 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 19 Nov 2024 11:44:50 -0500 Subject: [PATCH 12/12] Fix GitHub workflows --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 31fe23a..02efd56 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -38,7 +38,7 @@ jobs: echo "BUNDLE_NAME=$(ls Bundled/dist | head -1 | xargs)" >> $GITHUB_ENV - name: 📥 Zip Bundle - uses: thedoctor0/zip-release@0.7.* + uses: thedoctor0/zip-release@0.7.6 with: type: 'zip' directory: 'Bundled/dist/'