enpt
Advanced tools
@@ -80,2 +80,6 @@ # -*- coding: utf-8 -*- | ||
| @property | ||
| def logger(self): | ||
| return self.L2_obj.logger if self.L2_obj else self.L1_obj.logger if self.L1_obj else None | ||
| def extract_zip_archive(self, path_zipfile: str, subdir: str = '') -> str: | ||
@@ -273,9 +277,12 @@ """Extract the given EnMAP image zip archive and return the L1B image root directory path. | ||
| self.write_output() | ||
| self.logger.info('Total runtime of the processing chain: %s' | ||
| % timedelta(seconds=time() - self._time_startup)) | ||
| self.L1_obj.logger.info('Total runtime of the processing chain: %s' | ||
| % timedelta(seconds=time() - self._time_startup)) | ||
| finally: | ||
| # clean up temporary files | ||
| self.cleanup() | ||
| # close the latest active logger (either self.L1_obj.logger or self.L2_obj.logger) | ||
| self.logger.close() | ||
| @staticmethod | ||
@@ -308,5 +315,5 @@ def _write_to_stdout_stderr(): | ||
| if remaining_files: | ||
| self.L1_obj.logger.warning( | ||
| self.logger.warning( | ||
| f"Failed to completely delete EnPT´s temporary files at {self.cfg.working_dir}. \n" | ||
| f"Remaining files: \n" | ||
| f"{f'{chr(10)}'.join(natsorted(remaining_files))}") |
@@ -376,5 +376,13 @@ # -*- coding: utf-8 -*- | ||
| # move logfile to output folder and rename to L2A format | ||
| shutil.move(self.logger.path_logfile, path.join(product_dir, f'{self.meta.scene_basename}-ENPT_LOG.log')) | ||
| # move logfile to output folder and rename to L2A format (logger needs to be closed and reinitialized) | ||
| path_l1b_logfile = self.logger.path_logfile | ||
| path_l2a_logfile = path.join(product_dir, f'{self.meta.scene_basename}-ENPT_LOG.log') | ||
| self.logger.close() | ||
| shutil.move(path_l1b_logfile, path_l2a_logfile) | ||
| self._logger = EnPT_Logger('log__' + self.meta.scene_basename, | ||
| fmt_suffix=None, | ||
| path_logfile=path_l2a_logfile, | ||
| log_level=self.cfg.log_level, | ||
| append=True) | ||
| return product_dir |
@@ -39,2 +39,3 @@ # -*- coding: utf-8 -*- | ||
| import sys | ||
| import os | ||
@@ -108,2 +109,8 @@ from packaging.version import parse as parse_version | ||
| """Return True if ACWater/Polymer is operable, else raise a warning and return False.""" | ||
| if os.name == 'nt': | ||
| logger.warning("The Polymer atmospheric correction for water is not yet fully operable on Windows. " | ||
| "As a fallback, SICOR is applied to water surfaces instead.") | ||
| return False | ||
| try: | ||
@@ -110,0 +117,0 @@ import acwater as _acwater # noqa: F401 |
@@ -36,3 +36,3 @@ # -*- coding: utf-8 -*- | ||
| import sys | ||
| from io import StringIO # Python 3 only | ||
| from io import StringIO | ||
@@ -124,2 +124,7 @@ __author__ = 'Daniel Scheffler' | ||
| # read existing log file to captured_stream if append is True | ||
| if append and path_logfile and os.path.isfile(path_logfile): | ||
| with open(path_logfile, 'r') as f: | ||
| self.captured_stream += f.read() | ||
| def __getstate__(self): | ||
@@ -144,5 +149,7 @@ self.close() | ||
| """ | ||
| if not self._captured_stream: | ||
| self._captured_stream = self.streamObj.getvalue() | ||
| value = self.streamObj.getvalue() | ||
| if value: | ||
| self._captured_stream += value | ||
| self.streamObj.truncate(0) | ||
| self.streamObj.seek(0) | ||
| return self._captured_stream | ||
@@ -157,4 +164,4 @@ | ||
| """Close all logging handlers.""" | ||
| # update captured_stream and flush stream | ||
| self.captured_stream += self.streamObj.getvalue() | ||
| # drain StringIO once | ||
| _ = self.captured_stream | ||
@@ -161,0 +168,0 @@ for handler in self.handlers[:]: |
+2
-2
@@ -30,4 +30,4 @@ # -*- coding: utf-8 -*- | ||
| __version__ = '1.2.0' | ||
| __versionalias__ = '20260216.01' | ||
| __version__ = '1.2.1' | ||
| __versionalias__ = '20260225.01' | ||
| __author__ = 'Daniel Scheffler' |
+10
-0
@@ -5,2 +5,12 @@ ======= | ||
| 1.2.1 (2026-02-25) | ||
| ------------------ | ||
| * !134: Blocked Polymer on Windows for now (AUX downloads and multiprocessing are not yet operable). | ||
| * !135: Use latest version of EnPT in environment files to prevent installation of outdated versions. | ||
| * !136: Fixed #151 ([Windows] PermissionError when moving log file to final L2A product). | ||
| * Updated GUI screenshot. | ||
| 1.2.0 (2026-02-16) | ||
@@ -7,0 +17,0 @@ ------------------ |
+1
-1
| Metadata-Version: 2.4 | ||
| Name: enpt | ||
| Version: 1.2.0 | ||
| Version: 1.2.1 | ||
| Summary: EnMAP Processing Tool | ||
@@ -5,0 +5,0 @@ Project-URL: Source code, https://git.gfz.de/EnMAP/GFZ_Tools_EnMAP_BOX/EnPT |
Sorry, the diff of this file is too big to display
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
2411528
0.09%8906
0.29%