diff --git a/.stickler.yml b/.stickler.yml new file mode 100644 index 0000000..1c51f63 --- /dev/null +++ b/.stickler.yml @@ -0,0 +1,4 @@ +linters: + flake8: + python: 3 + config: setup.cfg diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5038c4d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,40 @@ +language: python +env: + global: + - PYTHON_VERSION=$TRAVIS_PYTHON_VERSION + - NUMPY_VERSION=stable + - MAIN_CMD='python setup.py' + - CONDA_DEPENDENCIES='netcdf4 hdf5 coveralls coverage pytest pytest-cov' + - PIP_DEPENDENCIES='' + - SETUP_XVFB=False + - EVENT_TYPE='push pull_request' + - SETUP_CMD='test' + - CONDA_CHANNELS='conda-forge' + - CONDA_CHANNEL_PRIORITY="strict" +matrix: + include: + - env: PYTHON_VERSION=3.6 + os: linux + - env: PYTHON_VERSION=3.7 + os: linux + - env: PYTHON_VERSION=3.8 + os: linux +install: +- git clone --depth 1 git://github.com/astropy/ci-helpers.git +- source ci-helpers/travis/setup_conda.sh +- pip install -e . +script: +- pytest --cov=pygac_fdr pygac_fdr/tests +after_success: +- if [[ $PYTHON_VERSION == 3.7 ]]; then coveralls; fi +deploy: + matrix: + - provider: pypi + user: sfinkens + password: + secure: MlHWi5HGZOU2rHJ9dcKqPVGIZgQVpW+T36x1Xplh0WvNsTqDUBP4HZlfFCUiFPdupKfZpMJu1ZlaPJyX8WP9ii5pdNpwsmiRZy4TcydDs8//2x53AJT27StgfSGVKnTZc1rk8M1MA1s4/o85FDJ6SgvXOeWQvs7e0z5GTBUVnCXg7YK0WLgUf8KNHtVwDkFjW1JaUutnCL/6aUpgQ+Pr1/bwM/NT4ZmDlRiv/TjqcXVKDysUt3/Oa1+9WHi1mnfuqyY3u9mMQjxqgEhDc57s5S4kItBi3d5M3dzR7vz4exss5isIEEnVIAYZ+nBv4hMOaYQHEpTPoggGsLNHEa2Pkx79SKHF96M5WoLO6vc+J+RCTUbRkL+yr9ZSbGQN1chPHsRIKAfLtlgrwXDmDwPWnSmzQ0jL8PPNvpr+oyxb9iVjEA3ZSTBz0FnEfbwZP6g/gmMbGi2eJr+7iUTlQ3ipDpi+JIvKgvIO+poTMh1GcNyzqXREFqojTakBEW9y82IUrJmxzDIwtnWoO1H/Aegl/JvTokFdEq1O8bCFIqyPsRoHgOatJqEXzrJRuXBJ09lJaCwDHh1P9rbW7tNsKuYTHVVyMqbcytRjZWBEHvjtHyNCSDyAxMJz02pJw7qaADO7e/Yv788naVKnXyI0I/GMqsX63MIL5qba0zQw0QvgtBA= + distributions: sdist + skip_existing: true + on: + tags: true + repo: pytroll/pygac-fdr diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..d6d848b --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,14 @@ +# Project Contributors + +The following people have made contributions to this project: + + + + + +- M. D.-B. +- [Stephan Finkensieper (sfinkens)](https://github.com/sfinkens) +- [Mike Grant (mikeggrant-eumetsat)](https://github.com/mikeggrant-eumetsat) +- [Carlos Horn (carloshorn)](https://github.com/carloshorn) +- [Martin Raspaud (mraspaud)](https://github.com/mraspaud) +- [Oliver Sus (oliversus)](https://github.com/oliversus) diff --git a/README.md b/README.md index 8cadac7..02710ad 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # pygac-fdr Python package for creating a Fundamental Data Record (FDR) of AVHRR GAC data using pygac +[![Build](https://travis-ci.com/pytroll/pygac-fdr.svg?branch=master)](https://travis-ci.com/github/pytroll/pygac-fdr?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/pytroll/pygac-fdr/badge.svg?branch=master)](https://coveralls.io/github/pytroll/pygac-fdr?branch=master) +[![PyPI version](https://badge.fury.io/py/pygac-fdr.svg)](https://badge.fury.io/py/pygac-fdr) + Installation ============ diff --git a/pygac_fdr/__init__.py b/pygac_fdr/__init__.py index e2cf838..bd9710a 100644 --- a/pygac_fdr/__init__.py +++ b/pygac_fdr/__init__.py @@ -28,6 +28,6 @@ # If the wheels of netCDF4 (used by this module) and h5py (imported by pygac) are incompatible, # segfaults or runtime errors like "NetCDF: HDF error" might occur. Prevent this by importing # netCDF4 first. - import netCDF4 + import netCDF4 # noqa: F401 except ImportError: pass diff --git a/pygac_fdr/config.py b/pygac_fdr/config.py index 2cf4fdd..5c2f034 100644 --- a/pygac_fdr/config.py +++ b/pygac_fdr/config.py @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License along with # pygac-fdr. If not, see . +"""Config file parsing.""" + import yaml @@ -28,4 +30,4 @@ def read_config(filename): if required not in config or config[required] is None: config[required] = {} - return config \ No newline at end of file + return config diff --git a/pygac_fdr/metadata.py b/pygac_fdr/metadata.py index 64a41f7..b35191a 100644 --- a/pygac_fdr/metadata.py +++ b/pygac_fdr/metadata.py @@ -1,3 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2020 pygac-fdr developers +# +# This file is part of pygac-fdr. +# +# pygac-fdr 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. +# +# pygac-fdr 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 +# pygac-fdr. If not, see . + +"""Collect and complement L1C metadata.""" + from datetime import datetime from enum import IntEnum import logging diff --git a/pygac_fdr/tests/__init__.py b/pygac_fdr/tests/__init__.py index e69de29..e90b28d 100644 --- a/pygac_fdr/tests/__init__.py +++ b/pygac_fdr/tests/__init__.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2020 pygac-fdr developers +# +# This file is part of pygac-fdr. +# +# pygac-fdr 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. +# +# pygac-fdr 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 +# pygac-fdr. If not, see . diff --git a/pygac_fdr/tests/test_metadata.py b/pygac_fdr/tests/test_metadata.py index 1f59d04..ed8bf86 100644 --- a/pygac_fdr/tests/test_metadata.py +++ b/pygac_fdr/tests/test_metadata.py @@ -201,7 +201,7 @@ def get_mda(self, multi_platform=False): 'global_quality_flag': QualityFlags.OK, 'global_quality_flag_exp': QualityFlags.OK} ] - + # Add exact copy with another platform if multi_platform: noaa17 = [rec.copy() for rec in mda] diff --git a/pygac_fdr/utils.py b/pygac_fdr/utils.py index f568606..f1568d1 100644 --- a/pygac_fdr/utils.py +++ b/pygac_fdr/utils.py @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License along with # pygac-fdr. If not, see . +"""Miscellaneous utilities.""" + import logging _is_logging_on = False diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..6deafc2 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120 diff --git a/setup.py b/setup.py index 3d9c853..441ca83 100644 --- a/setup.py +++ b/setup.py @@ -28,13 +28,21 @@ if __name__ == '__main__': - requires = ['setuptools_scm', 'numpy', 'netCDF4', 'pygac >=1.3.1', 'satpy >=0.21.0', 'pyyaml'] - test_requires = ['pytest'] + requires = ['setuptools_scm', 'numpy', 'xarray >=0.15.1', 'pandas >=1.0.3', 'netCDF4', + 'h5py', 'pygac >=1.3.1', 'satpy >=0.21.0', 'pyyaml'] README = open('README.md', 'r').read() setup(name='pygac-fdr', description='Python package for creating a Fundamental Data Record (FDR) of AVHRR GAC ' 'data using pygac', long_description=README, + long_description_content_type='text/markdown', + classifiers=["Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 " + + "or later (GPLv3+)", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Scientific/Engineering"], author='The Pytroll Team', author_email='pytroll@googlegroups.com', url="https://github.com/pytroll/pygac-fdr", @@ -42,6 +50,5 @@ scripts=[os.path.join('bin', item) for item in os.listdir('bin')], use_scm_version=True, install_requires=requires, - tests_require=test_requires, python_requires='>=3.6', )