Sat, 09 Jan 2021 19:24:29 +0200
Small stylistic changes.
CHANGELOG.rst | file | annotate | diff | comparison | revisions | |
scc_access/scc_access.py | file | annotate | diff | comparison | revisions |
--- a/CHANGELOG.rst Sat Jan 09 18:46:13 2021 +0200 +++ b/CHANGELOG.rst Sat Jan 09 19:24:29 2021 +0200 @@ -3,6 +3,8 @@ 0.9.0 - 2021-01-09 ------------------ * Added force_upload option +* Removed the process subcommand, added the --process option to the `upload_file` subcommand. +* Homogenised download directory names. 0.8.1 - 2019-12-19 ------------------
--- a/scc_access/scc_access.py Sat Jan 09 18:46:13 2021 +0200 +++ b/scc_access/scc_access.py Sat Jan 09 19:24:29 2021 +0200 @@ -106,7 +106,7 @@ measurement_id = self.measurement_id_from_file(filename) logger.debug('Checking if a measurement with the same id already exists on the SCC server.') - existing_measurement = self.get_measurement(measurement_id) + existing_measurement, _ = self.get_measurement(measurement_id) if existing_measurement: if force_upload: @@ -154,7 +154,7 @@ logger.debug('Adding lidar ratio file %s' % lr_filename) files['lidar_ratio_file'] = open(lr_filename, 'rb') - logger.info("Uploading of file(s) %s started." % filename) + logger.info("Uploading of file %s started." % filename) upload_submit = self.session.post(self.upload_url, data=upload_data, @@ -235,7 +235,7 @@ # Construct the download url download_url = self.download_hirelpp_pattern.format(measurement_id) try: - self.download_files(measurement_id, 'scc_hirelpp', download_url) + self.download_files(measurement_id, 'hirelpp', download_url) except Exception as e: logger.error("Could not download HiRElPP files. Error message: {}".format(e)) logger.debug('Download exception:', exc_info=True) @@ -245,7 +245,7 @@ # Construct the download url download_url = self.download_cloudmask_pattern.format(measurement_id) try: - self.download_files(measurement_id, 'scc_cloudscreen', download_url) + self.download_files(measurement_id, 'cloudscreen', download_url) except Exception as e: logger.error("Could not download cloudscreen files. Error message: {}".format(e)) logger.debug('Download exception:', exc_info=True) @@ -255,7 +255,7 @@ # Construct the download url download_url = self.download_elpp_pattern.format(measurement_id) try: - self.download_files(measurement_id, 'scc_preprocessed', download_url) + self.download_files(measurement_id, 'elpp', download_url) except Exception as e: logger.error("Could not download ElPP files. Error message: {}".format(e)) logger.debug('Download exception:', exc_info=True) @@ -265,7 +265,7 @@ # Construct the download url download_url = self.download_elda_pattern.format(measurement_id) try: - self.download_files(measurement_id, 'scc_optical', download_url) + self.download_files(measurement_id, 'elda', download_url) except Exception as e: logger.error("Could not download ELDA files. Error message: {}".format(e)) logger.debug('Download exception:', exc_info=True) @@ -275,7 +275,7 @@ # Construct the download url download_url = self.download_plots_pattern.format(measurement_id) try: - self.download_files(measurement_id, 'scc_plots', download_url) + self.download_files(measurement_id, 'elda_plots', download_url) except Exception as e: logger.error("Could not download ELDA plots. Error message: {}".format(e)) logger.debug('Download exception:', exc_info=True) @@ -285,7 +285,7 @@ # Construct the download url download_url = self.download_elic_pattern.format(measurement_id) try: - self.download_files(measurement_id, 'scc_elic', download_url) + self.download_files(measurement_id, 'elic', download_url) except Exception as e: logger.error("Could not download ELIC files. Error message: {}".format(e)) logger.debug('Download exception:', exc_info=True) @@ -295,7 +295,7 @@ # Construct the download url download_url = self.download_elda_pattern.format(measurement_id) # ELDA patter is used for now try: - self.download_files(measurement_id, 'scc_eldec', download_url) + self.download_files(measurement_id, 'eldec', download_url) except Exception as e: logger.error("Could not download EDELC files. Error message: {}".format(e)) logger.debug('Download exception:', exc_info=True) @@ -345,14 +345,14 @@ """ logger.info("--- Processing started on %s. ---" % datetime.datetime.now()) # Upload file - logger.info("--- Uploading file") + logger.info("Uploading file.") measurement_id = self.upload_file(filename, system_id, force_upload, delete_related, rs_filename=rs_filename, lr_filename=lr_filename, ov_filename=ov_filename) if measurement_id and monitor: - logger.info("--- Monitoring processing") + logger.info("Monitoring processing") return self.monitor_processing(measurement_id) return None @@ -367,7 +367,7 @@ # try to wait for measurement to appear in API measurement = None - logger.info("Looking for measurement %s on SCC", measurement_id) + logger.info("Looking for measurement %s on the SCC.", measurement_id) while error_count < error_max: time.sleep(time_sleep) measurement, status = self.get_measurement(measurement_id) @@ -408,7 +408,7 @@ if measurement.elda == 127: logger.info("Downloading ELDA files.") self.download_elda(measurement_id) - logger.info("Downloading graphs.") + logger.info("Downloading ELDA plots.") self.download_plots(measurement_id) if measurement.elic == 127: logger.info("Downloading ELIC files.")