Skip to content

Commit

Permalink
add version.py and badges in README
Browse files Browse the repository at this point in the history
+ add version.py for a explicit list of release history
+ setup.py: grab version number from version.py, instead of manual change
+ README: add badges, to be consistent with other insarlab repos
  • Loading branch information
yunjunz committed Nov 27, 2021
1 parent 0f47a63 commit aea51b4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[![Language](https://img.shields.io/badge/python-3.6%2B-blue.svg)](https://www.python.org/)
[![CircleCI](https://img.shields.io/circleci/build/github/insarlab/PyAPS.svg?logo=circleci&label=test)](https://circleci.com/gh/insarlab/PyAPS)
[![Version](https://img.shields.io/badge/version-v0.3.1-green.svg)](https://github.com/insarlab/PyAPS/releases)
[![License](https://img.shields.io/badge/license-GPLv3-yellow.svg)](https://github.com/insarlab/PyAPS/blob/main/LICENSE)
[![Citation](https://img.shields.io/badge/doi-10.1029%2F2011GL048757-blue)](https://doi.org/10.1029/2011GL048757)

## PyAPS - Python based Atmospheric Phase Screen estimation

This python 3 module estimates differential phase delay maps due to the stratified atmosphere for correcting radar interferograms. It is rewritten in Python 3 language from PYAPS source code and adapted for ECMWF's ERA-5 corrections.
Expand Down
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
from setuptools import setup, find_packages


# Grab from version.py file: version
with open("src/pyaps3/version.py", "r") as f:
lines = f.readlines()
line = [line for line in lines if line.strip().startswith("Tag(")][0].strip()
version = line.replace("'",'"').split('"')[1]


# Grab from README file: long_description
with open("README.md", "r") as f:
long_description = f.read()


setup(
name='pyaps3',
version='0.3.0',
version=version,
description="Python based Atmospheric Phase Screen Estimation",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
20 changes: 20 additions & 0 deletions src/pyaps3/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
# Author: Zhang Yunjun, Nov 2021
# Copyright 2012, by the California Institute of Technology.


import collections

# release history
Tag = collections.namedtuple('Tag', 'version date')
release_history = (
Tag('0.3.1', '2021-11-26'),
Tag('0.3.0', '2021-11-15'),
Tag('0.2.0', '2021-08-31'),
Tag('0.1.0', '2019-04-07'),
)

# latest release
release_version = 'v{}'.format(release_history[0].version)
release_date = release_history[0].date

0 comments on commit aea51b4

Please sign in to comment.