From 70ad54a90b4c81889bbcdbdd198805342cffc5db Mon Sep 17 00:00:00 2001 From: "Nina.Hakansson" Date: Thu, 20 May 2021 13:49:34 +0200 Subject: [PATCH 1/6] Fixed typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ab59b9..dee46a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Pull Requests Merged - #### Features addedes +#### Features addeded * [PR 60](https://github.com/foua-pps/level1c4pps/pull/60) - Add support for github-ci and prepare releasing on PyPi From 474b5005563f3949925479f3f040e7686d8e6570 Mon Sep 17 00:00:00 2001 From: "Nina.Hakansson" Date: Thu, 20 May 2021 13:49:53 +0200 Subject: [PATCH 2/6] Main branch is still called master --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fd145f5..b9ba28d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ level1c4pps =========== -[![Build status](https://github.com/foua-pps/level1c4pps/workflows/CI/badge.svg?branch=main)](https://github.com/foua-pps/level1c4pps/workflows/CI/badge.svg?branch=master) -[![Coverage Status](https://coveralls.io/repos/github/foua-pps/level1c4pps/badge.svg)](https://coveralls.io/github/foua-pps/level1c4pps) +[![Build status](https://github.com/foua-pps/level1c4pps/workflows/CI/badge.svg?branch=master)](https://github.com/foua-pps/level1c4pps/workflows/CI/badge.svg?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/foua-pps/level1c4pps/badge.svg)](https://coveralls.io/github/foua-pps/level1c4pps?branch=master) Tools to generate NWCSAF/PPS level-1C formattet netCDF files from various From 48df294cef30f831142cef073a012745e60b272d Mon Sep 17 00:00:00 2001 From: "Nina.Hakansson" Date: Thu, 20 May 2021 14:20:51 +0200 Subject: [PATCH 3/6] Updates to release instructions --- RELEASING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASING.md b/RELEASING.md index 48eb2de..0271c52 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -12,6 +12,10 @@ prerequisites: `pip install setuptools twine` loghub foua-pps/level1c4pps --token -st v -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes" ``` +The "--token " somtimes can be excluded. + +Paste CHANGELOG.temp to CHANGELOG.md and update RELEASE-VERSION to the version that will be released. + Don't forget to commit! 5. Create a tag with the new version number, starting with a 'v', eg: @@ -23,7 +27,7 @@ git tag -a v0.1.1 -m "Version 0.1.1" See [semver.org](http://semver.org/) on how to write a version number. -6. push changes to github `git push --follow-tags` +6. push changes to github `git push name-of-foua-pps-repo master --follow-tags` 7. Verify the Github actions unit tests passed From 50abd531fecbc8a93b28d5eb97c1ab3736e5ceb1 Mon Sep 17 00:00:00 2001 From: "Nina.Hakansson" Date: Thu, 20 May 2021 14:21:30 +0200 Subject: [PATCH 4/6] Added .coveragerc for coveralls --- .coveragerc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..bf9bc4c --- /dev/null +++ b/.coveragerc @@ -0,0 +1,14 @@ +[run] +branch = True +source = level1c4pps +relative_files = True + +[report] +exclude_lines = + if self.debug: + pragma: no cover + raise NotImplementedError + if __name__ == .__main__.: +ignore_errors = True +omit = + tests/* From efbf04814d5897f5b9d56adc43c300c7eb07a934 Mon Sep 17 00:00:00 2001 From: "Nina.Hakansson" Date: Thu, 20 May 2021 14:30:00 +0200 Subject: [PATCH 5/6] Remove no longer used old test-script --- tests/seviri2pps_for_dirs.py | 52 ------------------------------------ 1 file changed, 52 deletions(-) delete mode 100644 tests/seviri2pps_for_dirs.py diff --git a/tests/seviri2pps_for_dirs.py b/tests/seviri2pps_for_dirs.py deleted file mode 100644 index 41ecb55..0000000 --- a/tests/seviri2pps_for_dirs.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright (c) 2019 Nina.Hakansson - -# Author(s): - -# Nina.Hakansson - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import os -from glob import glob -from seviri2pps import process_all_scans_in_dname - - -if __name__ == "__main__": - #For testing: - my_tar_file = "local_disk/DATA_MISC/SEVIRI/20100208_15_MSG2.tar" - my_temp_dir = "local_disk/temp/SEVIRI" - out_path = "local_disk/DATA_MISC/SEVIRI/" - sdate = "20100208" - stime = "201002081715" - - tar_command = "tar -xvf %s -C %s"%(my_tar_file, my_temp_dir) - files = glob("%s/%s/%s/*"%(my_temp_dir,sdate,stime)) - for filename in files: - bzip2_command = "bzip2 -d %s"%(filename) - dirl = glob("%s/%s/%s/"%(my_temp_dir,sdate,stime)) - - for dirname in dirl: - print("Directory: ", dirname) - if not os.path.isdir(dirname): - print("Can't find directory.") - continue - try: - process_all_scans_in_dname(dirname, out_path) - except: - raise - - From d9a23844e712eae2b4aea6afe4d27acfe3ee0b4e Mon Sep 17 00:00:00 2001 From: "Nina.Hakansson" Date: Thu, 20 May 2021 14:30:14 +0200 Subject: [PATCH 6/6] flake8 --- level1c4pps/eumgacfdr2pps_lib.py | 7 ++----- level1c4pps/tests/test_init.py | 1 + level1c4pps/tests/test_seviri2pps.py | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/level1c4pps/eumgacfdr2pps_lib.py b/level1c4pps/eumgacfdr2pps_lib.py index 95b985f..0b1ca85 100644 --- a/level1c4pps/eumgacfdr2pps_lib.py +++ b/level1c4pps/eumgacfdr2pps_lib.py @@ -26,20 +26,17 @@ import os import time +import satpy from satpy.scene import Scene from level1c4pps import (get_encoding, compose_filename, set_header_and_band_attrs_defaults, - remove_attributes, rename_latitude_longitude, update_angle_attributes, dt64_to_datetime, - platform_name_to_use_in_filename, - fix_too_great_attributes, logger, get_header_attrs, convert_angles) from satpy.utils import debug_on -debug_on() from distutils.version import LooseVersion -import satpy + if LooseVersion(satpy.__version__) < LooseVersion('0.24.0'): debug_on() raise ImportError("'eumgac2pps' writer requires satpy 0.24.0 or greater") diff --git a/level1c4pps/tests/test_init.py b/level1c4pps/tests/test_init.py index 7b9838c..9f94a35 100644 --- a/level1c4pps/tests/test_init.py +++ b/level1c4pps/tests/test_init.py @@ -35,6 +35,7 @@ def test_get_band_encoding(self): None, None) def test_adjust_lons(self): + """Test adjusted longitudes.""" from level1c4pps import centered_modulus in_lons = xr.DataArray([340.0, 10.0, -22.0]) out_lons = xr.DataArray([-20.0, 10.0, -22.0]) diff --git a/level1c4pps/tests/test_seviri2pps.py b/level1c4pps/tests/test_seviri2pps.py index a41e2e8..316400b 100644 --- a/level1c4pps/tests/test_seviri2pps.py +++ b/level1c4pps/tests/test_seviri2pps.py @@ -38,6 +38,8 @@ class TestSeviri2PPS(unittest.TestCase): + """Test for SEVIRI converter.""" + def test_rotate_band(self): """Test rotation of bands.""" area = AreaDefinition(area_id='test', @@ -432,8 +434,9 @@ def test_add_proj_satpos(self): np.testing.assert_array_equal(scene['satellite_altitude'], [30]) - class TestCalibration(unittest.TestCase): + """Test SEVIRI calibration.""" + def test_get_calibration_for_date(self): """Test MODIS-intercalibrated gain and offset for specific date.""" coefs = calib.get_calibration_for_date(