Skip to content

Commit aea51b4

Browse files
committed
add version.py and badges in README
+ 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
1 parent 0f47a63 commit aea51b4

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
[![Language](https://img.shields.io/badge/python-3.6%2B-blue.svg)](https://www.python.org/)
2+
[![CircleCI](https://img.shields.io/circleci/build/github/insarlab/PyAPS.svg?logo=circleci&label=test)](https://circleci.com/gh/insarlab/PyAPS)
3+
[![Version](https://img.shields.io/badge/version-v0.3.1-green.svg)](https://github.com/insarlab/PyAPS/releases)
4+
[![License](https://img.shields.io/badge/license-GPLv3-yellow.svg)](https://github.com/insarlab/PyAPS/blob/main/LICENSE)
5+
[![Citation](https://img.shields.io/badge/doi-10.1029%2F2011GL048757-blue)](https://doi.org/10.1029/2011GL048757)
6+
17
## PyAPS - Python based Atmospheric Phase Screen estimation
28

39
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.

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@
44
from setuptools import setup, find_packages
55

66

7+
# Grab from version.py file: version
8+
with open("src/pyaps3/version.py", "r") as f:
9+
lines = f.readlines()
10+
line = [line for line in lines if line.strip().startswith("Tag(")][0].strip()
11+
version = line.replace("'",'"').split('"')[1]
12+
13+
714
# Grab from README file: long_description
815
with open("README.md", "r") as f:
916
long_description = f.read()
1017

1118

1219
setup(
1320
name='pyaps3',
14-
version='0.3.0',
21+
version=version,
1522
description="Python based Atmospheric Phase Screen Estimation",
1623
long_description=long_description,
1724
long_description_content_type="text/markdown",

src/pyaps3/version.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python3
2+
# Author: Zhang Yunjun, Nov 2021
3+
# Copyright 2012, by the California Institute of Technology.
4+
5+
6+
import collections
7+
8+
# release history
9+
Tag = collections.namedtuple('Tag', 'version date')
10+
release_history = (
11+
Tag('0.3.1', '2021-11-26'),
12+
Tag('0.3.0', '2021-11-15'),
13+
Tag('0.2.0', '2021-08-31'),
14+
Tag('0.1.0', '2019-04-07'),
15+
)
16+
17+
# latest release
18+
release_version = 'v{}'.format(release_history[0].version)
19+
release_date = release_history[0].date
20+

0 commit comments

Comments
 (0)