Skip to content

Commit

Permalink
Merged from andover
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Blumberg committed Sep 12, 2019
2 parents 1c9b5d1 + 888b2bf commit 8ac0893
Show file tree
Hide file tree
Showing 703 changed files with 5,423 additions and 1,121 deletions.
45 changes: 31 additions & 14 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ environment:
- PYTHON_VERSION: 2.7
MINICONDA: C:\Miniconda
ARCH: "64"
NUMPY_VERSION: "1.15.*"
- PYTHON_VERSION: 3.6
MINICONDA: C:\Miniconda3
ARCH: "64"
NUMPY_VERSION: "1.15.*"
init:
- "ECHO %PYTHON_VERSION% %MINICONDA%"

Expand All @@ -14,41 +16,56 @@ install:
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- "conda create -q -n test-environment python=%PYTHON_VERSION% numpy nose"
- "conda create -q -n test-environment python=%PYTHON_VERSION%"

# Install dependencies
- activate test-environment
- conda install -c conda-forge pyside
- conda install -c conda-forge pyinstaller
- "conda install -q -c conda-forge pyside pyinstaller pytest requests python-dateutil numpy=%NUMPY_VERSION%"

# Add to path the current folder
- "SET PYTHONPATH=%PYTHONPATH%;%CD%"

# Install SHARPpy
- "python setup.py install"

# Make binaries using PyInstaller
- "pyinstaller runsharp/SHARPpy-win7-%ARCH%.spec"
- "move dist\\SHARPpy.exe dist\\SHARPpy%ARCH%.exe"
- python setup.py -q install

# Resize the screen
#- nuget restore
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/set-screenresolution.ps1'))
- ps: Set-ScreenResolution 1366 768

build: off

# Turning off Test Script for now
#test_script:
# - "python sharppy/tests/test_url.py https://www.spc.noaa.gov/exper/soundings/18112100_OBS/OUN.txt"
test_script:
# - sharppy examples/data/14061619.OAX
- pytest -v

after_test:
- "conda list"
- "cd runsharp"
- "pyinstaller SHARPpy-win7-%ARCH%.spec"
- "cd .."
# - "move dist\\SHARPpy.exe dist\\SHARPpy%ARCH%.exe"

artifacts:
path: "dist\\SHARPpy64.exe"
name: "SHARPpy64"
- path: "runsharp\\dist\\SHARPpy64.exe"
name: binary

- path: "*.png"
name: test images

- path: "examples\\data\\14061619.png"
name: test gui

deploy:
provider: GitHub
release: $(appveyor_repo_tag_name)
auth_token:
secure: DB6sQwYCM7Dhhy+mjPkMd6kclvw0Sc2wglTJxcTBQue63dtIQRNa1dz/aqJG7Ygc
artifact: "dist\\SHARPpy64.exe"
artifact: "runsharp\\dist\\SHARPpy64.exe"
draft: true
prerelease: true
on:
appveyor_repo_tag: true


# Don't deploy because andover-off
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[run]
source = sharppy
runsharp
datasources
omit =
*/tests*
_*.py
Expand All @@ -12,6 +14,10 @@ omit =
sharppy/viz/barbs.py
sharppy/viz/preferences.py
sharppy/viz/generic.py
sharppy/io/arw_decoder.py
runsharp/SHARPpy.py
datasources/available.py
sharppy/plot/*

[report]
exclude_lines =
Expand All @@ -35,3 +41,5 @@ exclude_lines =
def showCursorMenu
class SfcModifyDialog
class PWDatabase
def get_profile
def calc_inputs
47 changes: 24 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ matrix:
- os: linux
language: generic
env:
- PYTHON_VERSION="3.6" BUILD_CONDA="YES" PYTEST_ARGS="-v --cov" NUMPY_VERSION=1.15.*
- PYTHON_VERSION="3.6" BUILD_CONDA="YES" NUMPY_VERSION=1.15
- os: osx
language: generic
env:
- PYTHON_VERSION="3.6" DISPLAY_AVAIL="NO" BUILD_BINARY="YES" PYTEST_ARGS="-v --cov" NUMPY_VERSION=1.15.*
- PYTHON_VERSION="3.6" DISPLAY_AVAIL="NO" BUILD_BINARY="YES" NUMPY_VERSION=1.15
- os: linux
language: generic
env:
- PYTHON_VERSION="2.7" COVERALLS="YES" DISPLAY_AVAIL="YES" PYTEST_ARGS="-v --cov" NUMPY_VERSION=1.15.*
- PYTHON_VERSION="2.7" NUMPY_VERSION=1.15
- os: linux
language: generic
env:
- PYTHON_VERSION="3.6" BUILD_DOCS="YES" DISPLAY_AVAIL="YES" PYTEST_ARGS="-v --cov" NUMPY_VERSION=1.15.*
- PYTHON_VERSION="3.6" BUILD_DOCS="YES" NUMPY_VERSION=1.15 COVERALLS="YES"
before_install:
- source ci/install.sh
install:
- pip install -e .
script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then xvfb-run py.test -v --cov=sharppy sharppy/ ; else py.test -v --cov=sharppy sharppy/; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then xvfb-run pytest -v --cov ; else pytest -v --cov ; fi
# If the test script passes, deploy if it's tagged..generate the binaries.
after_success:
# Deploy test information to coveralls
- if [[ "$COVERALLS" == "YES" ]] ; then coveralls || echo "Coveralls failed" ;fi
- if [[ "$COVERALLS" == "YES" ]] ; then coveralls || echo "Coveralls upload failed" ;fi
# Build the binary if it's a new tag.
- if [[ -n "$TRAVIS_TAG" ]]; then source ci/make_binary.sh; fi
before_deploy:
- cd dist
- if [ "$BUILD_BINARY" == "YES" ] && [ -n "$TRAVIS_TAG" ]; then zip -r SHARPpy-osx.zip SHARPpy.app; fi
- cd ..
- ls
- pwd
- if [ "$BUILD_BINARY" == "YES" ] && [ -n "$TRAVIS_TAG" ]; then cd dist; zip -r SHARPpy-osx.zip SHARPpy.app; cd ..; fi
# Ship the binaries to Github and PyPI and conda
deploy:
# Deploy the binaries to Github Releases
Expand All @@ -53,31 +53,32 @@ deploy:
repo: sharppy/SHARPpy
tags: true
branch: andover
# Deploy the code to PyPI
- provider: pypi
user: sharppy
password:
secure: "qgE7Hef6m9m6xf0CU976z/7KbpSaRIeucwVztsJQQCqP97FMnkb0bL0fhQMoxkVti1VCAuF9FXvWzWBKuKeu+sqP3pEE7GYlTVqq4kN3W55DleVFbyWy3Fyhu+6pRJL168kZg1rCNboX7Xw8RwI0l0r3DiSvjqWSYvOfdabgYlECImS4XjxRYxN2GTDXG3D37soWiBbi7rqDj33fitUHXyJMLdPhtbGs85BStG9Op2aRXibtCH2Lo/EtY7PkWaxY8F5aXrKiufHPvkpow8S2XKD1VdWpHAV+5lO7ai9N8Z9zyogYLzIAfPqHDx6afQWUknRBn8Ot7k4Kt3cBGEhdvtAH8jhZGCmqDPsk1+qgx/OyWK9iiJsvsJWKmTf286AZl5vxO9NH1fZL0LpYQ5XvwrVi83eygLttEOU0I6ggngflJfs5KvfZXmvODdfK4oVzn3mJODbncLoYz1KxNZRPUFWycmkDaPmy2YyPjRnqE1S6SOP1zGVAEO2Leq/lGbB0J18b103oehyp6+t9KnpsoEhPDsr68xKCkKLl5QXVlfGikHJAMVI/CM0Hh8bva6bTNP5Ulsko6vYyvfGlbI0rEW3OJikvh0051M0lS175j3LMGj5Bs1iFZX43KoyebcfqYDtRQdrvigzsRAZoR9BdBAnVZtO5mfFMkrUtIX94Au8="
distributions: sdist bdist_wheel
upload_docs: no
on:
repo: sharppy/SHARPpy
tags: true
branch: andover
condition: "$BUILD_CONDA = YES"
# Deploy code to conda
- provider: script
script: bash ci/deploy_conda.sh
on:
repo: sharppy/SHARPpy
tags: true
tags: false
branch: andover
condition: "$BUILD_CONDA = YES"
# Deploy docs to Github Pages
- provider: script
script: bash ci/build_docs.sh
on:
repo: sharppy/SHARPpy
tags: true
tags: false
branch: andover
condition: "$BUILD_DOCS = YES"
# Deploy the code to PyPI
- provider: pypi
user: sharppy
password:
secure: "qgE7Hef6m9m6xf0CU976z/7KbpSaRIeucwVztsJQQCqP97FMnkb0bL0fhQMoxkVti1VCAuF9FXvWzWBKuKeu+sqP3pEE7GYlTVqq4kN3W55DleVFbyWy3Fyhu+6pRJL168kZg1rCNboX7Xw8RwI0l0r3DiSvjqWSYvOfdabgYlECImS4XjxRYxN2GTDXG3D37soWiBbi7rqDj33fitUHXyJMLdPhtbGs85BStG9Op2aRXibtCH2Lo/EtY7PkWaxY8F5aXrKiufHPvkpow8S2XKD1VdWpHAV+5lO7ai9N8Z9zyogYLzIAfPqHDx6afQWUknRBn8Ot7k4Kt3cBGEhdvtAH8jhZGCmqDPsk1+qgx/OyWK9iiJsvsJWKmTf286AZl5vxO9NH1fZL0LpYQ5XvwrVi83eygLttEOU0I6ggngflJfs5KvfZXmvODdfK4oVzn3mJODbncLoYz1KxNZRPUFWycmkDaPmy2YyPjRnqE1S6SOP1zGVAEO2Leq/lGbB0J18b103oehyp6+t9KnpsoEhPDsr68xKCkKLl5QXVlfGikHJAMVI/CM0Hh8bva6bTNP5Ulsko6vYyvfGlbI0rEW3OJikvh0051M0lS175j3LMGj5Bs1iFZX43KoyebcfqYDtRQdrvigzsRAZoR9BdBAnVZtO5mfFMkrUtIX94Au8="
distributions: sdist bdist_wheel
upload_docs: no
on:
repo: sharppy/SHARPpy
tags: true
branch: andover-off
condition: "$BUILD_CONDA = YES"

11 changes: 8 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ NEW FEATURES
* New data sources for international and U.S. users
* Realtime and historical U.S. and international soundings from 1946-now are accessible through the Picker. Soundings include the latitude and longitude.
* IEM BUFKIT sounding archive (data back to 2010 from RUC, NAM, GFS, RAP)
* New documentation and API accessible through Github pages
* Improved documentation online (no longer in README)
* Documentation and sphinx-generated API is pushed to Github Pages with each tagged release.
* Readout cursor can be configured to output other variables (e.g., potential temperature, theta-E)
* Ability to modify surface by changing the surface temperature or dewpoint (mixed layer optional)
* Up/down buttons on keyboard can now be used to flip through the ensemble members plotted in the SHARPpy GUI.
* Logging enabled when --debug flag is enabled.
* GUI now displays alert box when questionable data is requested to be plotted. Users now have the option to choose if they wish to still try to plot the data.
* Documentation and sphinx-generated API is pushed to Github Pages with each tagged release.
* Continuous Integration (TravisCI and Appveyor) now enabled to test changes, pull requests, deploy docs, deploy binaries to Github, and deploy packages to package managers.
* Continuous Integration (TravisCI, Appveyor, Azure Pipelines) now enabled to test changes, GUI quality, pull requests, deploy docs, deploy binaries to Github, and deploy packages to package managers.
* New versioning system now consistent with PEP-440 (thanks to versioneer).
* Included more scripting examples.
* Included more scripting examples in docs.
* Deployment to conda and pip with each tagged SHARPpy release.
* Added test scripts to unit test various GUI parts, decoders, and numerical routines
* GUI checks Github Releases to see if the code being run is the current version

BUG FIXES

Expand Down
99 changes: 89 additions & 10 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,67 @@ Some possible (broad) ideas for contributions:
3. Work on documentation of the code base.
4. Develop unit tests to test various aspects of the code.
5. Search through the `GitHub Issues page <https://github.com/sharppy/SHARPpy/issues>`_ for additional ideas!
6. Report and/or fix bugs on the Github Issues page.

Using the issue tracker
^^^^^^^^^^^^^^^^^^^^^^^

The issue tracker is the preferred channel for bug reports, feature requests and submitting pull
requests, but please respect the following restrictions:

* Please **do not** use the issue tracker for personal support requests (use
`Stack Overflow <http://stackoverflow.com>`_).

* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.

Bug reports
^^^^^^^^^^^

A bug is a *demonstrable problem* that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!

Guidelines for bug reports:

1. **Use the GitHub issue search** - check if the issue has already been
reported.

2. **Check if the issue has been fixed** - try to reproduce it using the
latest `master` or development branch in the repository.

3. **Isolate the problem** - create a `reduced test
case <http://css-tricks.com/reduced-test-cases/>`_ and document the steps.

A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What OS or Python packages
experience the problem? What would you expect to be the outcome? All these
details will help people to fix any potential bugs.

You should also attach any log and config files created by SHARPpy
(this is particularly helpful when debugging the GUI). These are kept in the ~/.sharppy directory.

Example::

Short and descriptive example bug report title
Information about your OS and package (e.g., numpy, Qt) dependencies including version numbers.
Include the steps required to reproduce the bug:
1. This is the first step
2. This is the second step
3. Further steps, etc.
Explain the expected behavior needed when performing these steps.
`<url>` - a link to the reduced test case
Any other information you want to share that is relevant to the issue being
reported. This might include the lines of code that you have identified as
causing the bug, and potential solutions (and your opinions on their
merits).


Set up a development environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -32,16 +93,17 @@ package if you wish to make a contribution to the program:
1. Install `miniconda <https://conda.io/miniconda.html>`_ on your system.
2. Install git on your system if it is not already there (install XCode command line tools on a Mac or git bash on Windows)
3. Login to your GitHub account and make a fork of the `SHARPpy repository <https://github.com/sharppy/SHARPpy/>`_ by clicking the "Fork" button.
4. Clone your fork of the SHARPpy repository (in terminal on Mac/Linux or git shell/GUI on Windows) in the location you'd like to keep it
``git clone https://github.com/your-user-name/SHARPpy.git``.
5. Navigate to that folder in the terminal or in Anaconda Prompt if you're on Windows.
``cd SHARPpy``
6. Connect your repository to the upstream (main project).
``git remote add sharppy https://github.com/sharppy/SHARPpy.git``
7. Create the development environment by running ``conda env create``. This will install
all of the packages in the ``environment.yml`` file.
8. Activate our new development environment ``source activate devel`` on Mac/Linux or
``activate devel`` on Windows.
4. Clone your fork of the SHARPpy repository (in terminal on Mac/Linux or git shell/GUI on Windows) in the location you'd like to keep it:
``git clone https://github.com/your-user-name/SHARPpy.git``

5. Navigate to that folder in the terminal or in Anaconda Prompt if you're on Windows:
``cd SHARPpy``

6. Connect your repository to the upstream (main project):
``git remote add sharppy https://github.com/sharppy/SHARPpy.git``

7. Create the development environment by running ``conda env create``. This will install all of the packages in the ``environment.yml`` file.
8. Activate our new development environment ``source activate devel`` on Mac/Linux or ``activate devel`` on Windows.
9. Make an editable install of SHARPpy by running ``pip install -e .``

Now you're all set! You have an environment called ``devel`` that you can work in. You'll need
Expand All @@ -52,6 +114,23 @@ terminal or your system. If you want to get back to the root environment, just r
Writing tests
^^^^^^^^^^^^^

Tests allow for the automated bots that analyze and run the SHARPpy code to make sure that:

1. The submitted code runs.
2. The submitted code behaves as expected (e.g. the CAPE routine provides the expected value given some test data.)

We ask that additions made to the SHARPpy code base include test scripts that are included in the ``sharppy/tests`` directory.
Example tests are included in this directory that others may use as a template for the tests they write.

To run the tests, navigate to the root directory of the project and run:

``pytest --cov -v``

pytest-cov must be installed for this to work!

This will generate a coverage report (telling you what percentage of the code was run during the tests) and run all of the test
functions included in the ``sharppy/tests`` directory.

Some Norms
^^^^^^^^^^

Expand Down
14 changes: 7 additions & 7 deletions LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ All rights reserved.
Copyright (c) 2012, MetPy Developers.
All rights reserved.

Copyright (c) 2018, Kelton Halbert, Greg Blumberg & Tim Supinie.
Copyright (c) 2019, Kelton Halbert, Greg Blumberg & Tim Supinie.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of the MetPy Developers nor the names of any
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand Down
Loading

0 comments on commit 8ac0893

Please sign in to comment.