Skip to content

Commit cf3f6b1

Browse files
committed
Last 0.2.2 commit
1 parent 3879436 commit cf3f6b1

145 files changed

Lines changed: 77 additions & 71 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ v0.2.2b0:
2626
2022-09-21 7395572 Heatmap with y categories and gaps fails; https://github.com/hapi-server/plot-python/issues/3
2727
2022-09-21 6c2a400 datetick failure when one value; https://github.com/hapi-server/plot-python/issues/4
2828
v0.2.2b1:
29+
2022-11-15 3879436 Remove depreciated (and unneeded) fig.canvas.set_window_title
30+
v0.2.2:

Makefile

Lines changed: 68 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# Development:
22
# Test repository code:
3-
# make repository-test # Test using $(PYTHON)
4-
# make repository-test-fast # Test w/o installing anaconda3 in .. (run after repository-test)
5-
# make repository-test-all # Test on all versions in $(PYTHONVERS)
3+
#
4+
# Test a single version of Python and Matplotlib; install anaconda3 & create env if needed.
5+
# make repository-test-single PYTHON=3.8 MATPLOTLIB=3.6
6+
#
7+
# Run tests that require visual inspection
8+
# make repository-test-single-visual PYTHON=3.8 MATPLOTLIB=3.6
9+
#
10+
# Test a single version of Python and all values of Matplotlib; create conda env if needed.
11+
# make repository-test PYTHON=3.8
12+
#
13+
# Remove ./anaconda3 and run all tests (all combos of Python/Matplotlib)
14+
# make repository-test-all
615
#
716
# Making a local package:
817
# 1. Update CHANGES.txt to have a new version line
9-
# 2. make package
10-
# 3. make package-test-all
18+
# 2. make package-test PYTHON=3.8 MATPLOTLIB=3.5 # (Probably don't need to test all combos)
19+
#
20+
# Test https://colab.research.google.com/github/hapi-server/client-python-notebooks/blob/master/hapi_demo.ipynb#examples
21+
#
1122
#
1223
# Upload package to pypi.org test starting with uploaded package:
1324
# 1. make release
@@ -24,26 +35,37 @@
2435
# is now in a pre-release state.
2536

2637
# https://matplotlib.org/stable/devel/min_dep_policy.html
27-
PYTHON=python3.5
28-
MATPLOTLIBS=3.0
29-
PYTHON_VER=$(subst python,,$(PYTHON))
38+
ifeq ($(PYTHON),3.5)
39+
MATPLOTLIBS=3.0
40+
endif
3041

31-
PYTHON=python3.6
32-
MATPLOTLIBS=3.0 3.1 3.2 3.3
33-
PYTHON_VER=$(subst python,,$(PYTHON))
42+
ifeq ($(PYTHON),3.6)
43+
MATPLOTLIBS=3.2 3.1 3.0
44+
endif
45+
46+
ifeq ($(PYTHON),3.7)
47+
MATPLOTLIBS=3.5 3.4 3.3 3.2 3.1 3.0
48+
endif
3449

35-
# Default Python version to use for tests
36-
PYTHON=python3.7
37-
MATPLOTLIBS=3.4 3.5
38-
PYTHON_VER=$(subst python,,$(PYTHON))
50+
ifeq ($(PYTHON),3.8)
51+
# 3.0 fails on OS-X with
52+
# "The C/C++ header for freetype2 (ft2build.h)
53+
# could not be found. You may need to install the
54+
# development package.""
55+
MATPLOTLIBS=3.6 3.5 3.4 3.3 3.2 3.1
56+
endif
57+
58+
ifeq ($(PYTHON),3.9)
59+
# 3.0-3.3 fail on OS-X with error: fatal error: 'ft2build.h' file not found
60+
MATPLOTLIBS=3.6 3.5 3.4
61+
endif
3962

4063
# Python versions to test
41-
# TODO: Use tox.
42-
PYTHONVERS=python3.8 python3.7 python3.6 python3.5
64+
PYTHONS=3.9 3.8 3.7 3.6 3.5
4365

4466
# VERSION is updated in "make version-update" step and derived
4567
# from CHANGES.txt. Do not edit.
46-
VERSION=0.2.2b1
68+
VERSION=0.2.2
4769
SHELL:= /bin/bash
4870

4971
LONG_TESTS=false
@@ -58,76 +80,59 @@ ifeq ($(TRAVIS_OS_NAME),windows)
5880
CONDA=/c/tools/miniconda3
5981
endif
6082

61-
6283
CONDA_ACTIVATE=source $(CONDA)/etc/profile.d/conda.sh; conda activate
6384

6485
# ifeq ($(shell uname -s),MINGW64_NT-10.0-18362)
6586
ifeq ($(TRAVIS_OS_NAME),windows)
6687
CONDA_ACTIVATE=source $(CONDA)/Scripts/activate; conda activate
6788
endif
6889

69-
7090
URL=https://upload.pypi.org/
7191
REP=pypi
7292

73-
pythonw=$(PYTHON)
74-
93+
pythonw=python$(PYTHON)
7594
# ifeq ($(shell uname -s),MINGW64_NT-10.0-18362)
7695
ifeq ($(TRAVIS_OS_NAME),windows)
7796
pythonw=python
7897
endif
79-
8098
ifeq ($(UNAME_S),Darwin)
8199
# Use pythonw instead of python. On OS-X, this prevents "need to install
82100
# python as a framework" error. The following finds the path to the binary
83101
# of $(PYTHON) and replaces it with pythonw, e.g.,
84102
# /opt/anaconda3/envs/python3.6/bin/python3.6
85103
# ->
86104
# /opt/anaconda3/envs/python3.6/bin/pythonw
87-
a=$(shell source activate $(PYTHON); which $(PYTHON))
88-
pythonw=$(subst bin/$(PYTHON),bin/pythonw,$(a))
105+
#a=$(shell source activate python-$(PYTHON)-matplotlib-$(MATPLOTLIB); which python$(PYTHON))
106+
#pythonw=$(subst bin/python$(PYTHON),bin/pythonw,$(a))
89107
endif
90108

91-
92109
################################################################################
93110
# Test contents in repository using different python versions
94111
test:
95112
make repository-test-all
96113

97114
repository-test-all:
98115
- rm -rf $(CONDA)
99-
@ for version in $(PYTHONVERS) ; do \
116+
@ for version in $(PYTHONS) ; do \
100117
make repository-test PYTHON=$$version ; \
101118
done
102119

103-
repository-test-single:
104-
make condaenv PYTHON=$(PYTHON)
105-
$(CONDA_ACTIVATE) $(PYTHON) && pip install matplotlib=="$(MATPLOTLIB).*"
106-
@ $(CONDA_ACTIVATE) $(PYTHON) && $(PYTHON) setup.py develop | grep "Best"
107-
# Not sure why the following is needed, but I get pytest install errors otherwise.
108-
@ $(CONDA_ACTIVATE) $(PYTHON) && pip install pytest pillow; pip install .
109-
$(CONDA_ACTIVATE) $(PYTHON) && $(PYTHON) -m pytest -rx -rP -v test/test_hapiplot.py
110-
111-
repository-test-fast:
112-
$(foreach MATPLOTLIB, $(MATPLOTLIBS), \
113-
make repository-test-single MATPLOTLIB=$(MATPLOTLIB) PYTHON=$(PYTHON); )
114-
115120
repository-test:
116-
@make clean
117-
rm -rf anaconda3
118121
$(foreach MATPLOTLIB, $(MATPLOTLIBS), \
119122
make repository-test-single MATPLOTLIB=$(MATPLOTLIB) PYTHON=$(PYTHON); )
120123

124+
repository-test-single:
125+
make anaconda3/envs/python-$(PYTHON)-matplotlib-$(MATPLOTLIB) MATPLOTLIB=$(MATPLOTLIB) PYTHON=$(PYTHON)
126+
$(CONDA_ACTIVATE) python-$(PYTHON)-matplotlib-$(MATPLOTLIB) && python$(PYTHON) -m pytest -rx -rP -v test/test_hapiplot.py
127+
121128
# These require visual inspection.
122-
repository-test-other:
129+
repository-test-single-visual:
123130
# Run using pythonw instead of python only so plot windows always work
124131
# for programs called from command line. This is needed for (at least)
125132
# OS-X, Python 3.5, and matplotlib instaled from pip.
126-
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) hapiplot_demo.py
127-
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) test/test_hapiplot_visual.py
128-
129-
#$(CONDA_ACTIVATE) $(PYTHON); $(PYTHON) hapiclient/autoplot/autoplot_test.py
130-
#$(CONDA_ACTIVATE) $(PYTHON); $(PYTHON) hapiclient/gallery/gallery_test.py
133+
make anaconda3/envs/python-$(PYTHON)-matplotlib-$(MATPLOTLIB) MATPLOTLIB=$(MATPLOTLIB) PYTHON=$(PYTHON)
134+
$(CONDA_ACTIVATE) python-$(PYTHON)-matplotlib-$(MATPLOTLIB); $(pythonw) hapiplot_demo.py
135+
$(CONDA_ACTIVATE) python-$(PYTHON)-matplotlib-$(MATPLOTLIB); $(pythonw) test/test_hapiplot_visual.py
131136
#jupyter-notebook ../client-python-notebooks/hapi_demo.ipynb
132137
################################################################################
133138

@@ -138,19 +143,23 @@ ifeq ($(shell uname -s),Darwin)
138143
CONDA_PKG=Miniconda3-latest-MacOSX-x86_64.sh
139144
endif
140145

141-
condaenv: ./anaconda3
142-
# ifeq ($(shell uname -s),MINGW64_NT-10.0-18362)
146+
anaconda3/envs/python-$(PYTHON)-matplotlib-$(MATPLOTLIB): anaconda3
143147
ifeq ($(TRAVIS_OS_NAME),windows)
144148
cp $(CONDA)/Library/bin/libcrypto-1_1-x64.* $(CONDA)/DLLs/
145149
cp $(CONDA)/Library/bin/libssl-1_1-x64.* $(CONDA)/DLLs/
146-
$(CONDA)/Scripts/conda create -y --name $(PYTHON) python=$(PYTHON_VER)
150+
$(CONDA)/Scripts/conda create -y --name python-$(PYTHON)-matplotlib-$(MATPLOTLIB) python=$(PYTHON)
147151
else
148152
$(CONDA_ACTIVATE); \
149-
$(CONDA)/bin/conda create -y --name $(PYTHON) python=$(PYTHON_VER)
153+
$(CONDA)/bin/conda create -y --name python-$(PYTHON)-matplotlib-$(MATPLOTLIB) python=$(PYTHON)
150154
endif
155+
$(CONDA_ACTIVATE) python-$(PYTHON)-matplotlib-$(MATPLOTLIB) && pip install matplotlib=="$(MATPLOTLIB).*"
156+
@ $(CONDA_ACTIVATE) python-$(PYTHON)-matplotlib-$(MATPLOTLIB) && python$(PYTHON) setup.py develop | grep "Best"
157+
# Not sure why the install of pytest is needed given it is in setup.py, but I get pytest install errors otherwise.
158+
# Note that pillow==8 is needed for Python 3.6. Ideally this would be set in setup.py.
159+
#@ $(CONDA_ACTIVATE) python-$(PYTHON)-matplotlib-$(MATPLOTLIB) && pip install pytest; pip install .
151160

152-
./anaconda3: /tmp/$(CONDA_PKG)
153-
bash /tmp/$(CONDA_PKG) -b -p $(CONDA)
161+
anaconda3: /tmp/$(CONDA_PKG)
162+
test -d anaconda3 || bash /tmp/$(CONDA_PKG) -b -p $(CONDA)
154163

155164
/tmp/$(CONDA_PKG):
156165
curl https://repo.anaconda.com/miniconda/$(CONDA_PKG) > /tmp/$(CONDA_PKG)
@@ -160,6 +169,7 @@ endif
160169
venv-test:
161170
cp hapiplot_demo.py /tmp # TODO: Explain why needed.
162171
source env-$(PYTHON)/bin/activate && \
172+
pip install pytest ipython && \
163173
pip uninstall -y hapiplot && \
164174
pip install --pre '$(PACKAGE)' \
165175
--index-url $(URL)/simple \
@@ -175,15 +185,10 @@ package:
175185
make version-update
176186
python setup.py sdist
177187

178-
package-test-all:
179-
@ for version in $(PYTHONVERS) ; do \
180-
make repository-test-plots PYTHON=$$version ; \
181-
done
182-
183188
env-$(PYTHON):
184-
$(CONDA_ACTIVATE) $(PYTHON); \
189+
$(CONDA_ACTIVATE) python-$(PYTHON)-matplotlib-$(MATPLOTLIB); \
185190
conda install -y virtualenv; \
186-
$(PYTHON) -m virtualenv env-$(PYTHON)
191+
python$(PYTHON) -m virtualenv env-$(PYTHON)
187192

188193
package-test:
189194
make package
@@ -205,13 +210,13 @@ release-upload:
205210
&& echo Uploaded to $(subst upload.,,$(URL))/project/hapiplot/
206211

207212
release-test-all:
208-
@ for version in $(PYTHONVERS) ; do \
213+
@ for version in $(PYTHONS) ; do \
209214
make release-test PYTHON=$$version ; \
210215
done
211216

212217
release-test:
213218
rm -rf env
214-
$(CONDA_ACTIVATE) $(PYTHON); pip install virtualenv; $(PYTHON) -m virtualenv env
219+
$(CONDA_ACTIVATE) $(PYTHON)-matplotlib-$(MATPLOTLIB); pip install virtualenv; python$(PYTHON) -m virtualenv env
215220
make venv-test PACKAGE='hapiplot==$(VERSION)'
216221
################################################################################
217222

@@ -231,7 +236,7 @@ version-tag:
231236
# Install package in local directory (symlinks made to local dir)
232237
install-local:
233238
#python setup.py -e .
234-
$(CONDA_ACTIVATE) $(PYTHON); pip install --editable .
239+
$(CONDA_ACTIVATE) $(PYTHON)-matplotlib-$(MATPLOTLIB); pip install --editable .
235240

236241
install:
237242
pip install 'hapiplot==$(VERSION)' --index-url $(URL)/simple

hapiplot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
#ignores = ['datapath','savefig.frameon', 'text.latex.unicode', 'verbose.fileo', 'verbose.level', 'datapath']
1717
warnings.filterwarnings(action='ignore', category=UserWarning)
1818

19-
__version__ = '0.2.2b1'
19+
__version__ = '0.2.2'

hapiplot/hapiplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
def hapiplot(*args, **kwargs):
1818
"""Plot response from HAPI server.
1919
20-
Version: 0.2.2b1
20+
Version: 0.2.2
2121
2222
Demos
2323
-----

hapiplot_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
def main():
1616

17-
demos = [omniweb, sscweb, cdaweb, cassini, lisird]
17+
demos = [omniweb, sscweb, cdaweb, lisird]
1818

1919
for demo in demos:
2020
try:

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
if len(sys.argv) > 1 and sys.argv[1] == 'develop':
88
install_requires.append("deepdiff<3.3.0")
9-
install_requires.append("pillow")
9+
install_requires.append("pillow==8.0")
1010
print(sys.version_info)
1111
if sys.version_info < (3, 6):
1212
install_requires.append("pytest<5.0.0")
@@ -21,7 +21,7 @@
2121
# version is modified by misc/version.py (executed from Makefile). Do not edit.
2222
setup(
2323
name='hapiplot',
24-
version='0.2.2b1',
24+
version='0.2.2',
2525
author='Bob Weigel',
2626
author_email='rweigel@gmu.edu',
2727
packages=find_packages(),
607 Bytes
607 Bytes
-31.8 KB
Binary file not shown.
-26.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)