Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into gsoc-develop-merge
Browse files Browse the repository at this point in the history
# Conflicts:
#	mslib/msui/_tests/test_mscolab.py
#	mslib/msui/_tests/test_mss_pyui.py
#	mslib/msui/mscolab.py
  • Loading branch information
aravindm711 committed Jul 13, 2021
2 parents 45b2343 + e2607fb commit 19faae6
Show file tree
Hide file tree
Showing 73 changed files with 2,386 additions and 1,497 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ jobs:
run: |
source /opt/conda/bin/activate mssenv \
&& cd $GITHUB_WORKSPACE \
&& pytest --cov=mslib mslib
&& pytest --cov=mslib mslib \
|| (for i in {1..5} \
; do pytest mslib --last-failed --lfnf=none \
&& break \
; done)
- name: coveralls
if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/xdist_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ jobs:
run: |
source /opt/conda/bin/activate mssenv \
&& cd $GITHUB_WORKSPACE \
&& pytest -n 6 --dist loadscope --max-worker-restart 0 mslib
&& pytest -n 6 --dist loadscope --max-worker-restart 0 mslib \
|| (for i in {1..5} \
; do pytest -n 6 --dist loadscope --max-worker-restart 0 mslib --last-failed --lfnf=none \
&& break \
; done)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ mslib/mswms/mss_wms_settings.py
mslib/mswms/mss_wms_auth.py
mslib/mscolab/colabdata/
docs/_build
docs/gallery/plots
docs/gallery/code
docs/gallery/plots.html
build/
mss.egg-info/
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
conda:
file: docs/environment.yml
4 changes: 3 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Contributors
============

in alphabetic order by first name


- Andreas Hilboll <hilboll@uni-bremen.de>
- Anveshan Lal <anveshanrx8@gmail.com>
Expand All @@ -10,10 +12,10 @@ Contributors
- Jens-Uwe Grooß <j.-u.grooss@fz-juelich.de>
- Jörn Ungermann <j.ungermann@fz-juelich.de>
- Marc Rautenhaus <wxmetvis@posteo.de>
- May Bär <m.baer@fz-juelich.de>
- Reimar Bauer <rb.proj@gmail.com>
- Sakshi Chopkar <sakshichopkar@gmail.com>
- Shivashis Padhi <shivashispadhi@gmail.com>
- Tanish Grover <tanish1908@gmail.com>
- Thomas Breuer <t.breuer@fz-juelich.de>
- Vaibhav Mehra <veb7vmehra@gmail.com>
- May Bär <m.baer@fz-juelich.de>
24 changes: 24 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
Changelog
=========

Version 4.0.3
~~~~~~~~~~~~~

Bug fix release

All changes:
https://github.com/Open-MSS/MSS/milestone/62?closed=1

Version 4.0.2
~~~~~~~~~~~~~

Bug fix release

All changes:
https://github.com/Open-MSS/MSS/milestone/60?closed=1

Version 4.0.1
~~~~~~~~~~~~~

Bug Fix release

All changes:
https://github.com/Open-MSS/MSS/milestone/58?closed=1

Version 4.0.0
-------------

Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def pytest_generate_tests(metafunc):
This file is part of mss.
:copyright: Copyright 2019 Shivashis Padhi
:copyright: Copyright 2019-2020 by the mss team, see AUTHORS.
:copyright: Copyright 2019-2021 by the mss team, see AUTHORS.
:license: APACHE-2.0, see LICENSE for details.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
65 changes: 65 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,57 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import sys
import logging
import setuptools
import subprocess
from string import Template

if os.getenv("PROJ_LIB") is None or os.getenv("PROJ_LIB") == "PROJ_LIB":
conda_file_dir = setuptools.__file__
conda_dir = conda_file_dir.split('lib')[0]
proj_lib = os.path.join(os.path.join(conda_dir, 'share'), 'proj')
if "win" in sys.platform:
proj_lib = os.path.join(os.path.join(conda_dir, 'Library'), 'share')
os.environ["PROJ_LIB"] = proj_lib
if not os.path.exists(proj_lib):
os.makedirs(proj_lib)
epsg_file = os.path.join(proj_lib, 'epsg')
if not os.path.exists(epsg_file):
with open(os.path.join(proj_lib, 'epsg'), 'w') as fid:
fid.write("# Placeholder for epsg data")

# Generate plot gallery
import fs
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
from mslib.mswms.demodata import DataFiles

root_fs = fs.open_fs("~/")
if not root_fs.exists("mss/testdata"):
root_fs.makedirs("mss/testdata")

examples = DataFiles(data_fs=fs.open_fs("~/mss/testdata"),
server_config_fs=fs.open_fs("~/mss"))
examples.create_server_config(detailed_information=True)
examples.create_data()

sys.path.insert(0, os.path.join(os.path.expanduser("~"), "mss"))

import mslib.mswms.wms
import mslib.mswms.gallery_builder

# Generate template plots
from docs.gallery.plot_examples import HS_template, VS_template
dataset = [next(iter(mslib.mswms.wms.mss_wms_settings.data))]
mslib.mswms.wms.mss_wms_settings.register_horizontal_layers = [(HS_template.HS_Template, dataset)]
mslib.mswms.wms.mss_wms_settings.register_vertical_layers = [(VS_template.VS_Template, dataset)]
mslib.mswms.wms.mss_wms_settings.register_linear_layers = []
mslib.mswms.wms.server.__init__()
mslib.mswms.wms.server.generate_gallery(sphinx=True, create=True, clear=True)
mslib.mswms.gallery_builder.plots = {"Top": [], "Side": [], "Linear": []}

# Generate all other plots
mslib.mswms.wms.server.generate_gallery(sphinx=True, generate_code=True, all_plots=True)

# readthedocs has no past.builtins
try:
Expand Down Expand Up @@ -69,6 +119,21 @@
# The full version, including alpha/beta/rc tags.
release = __version__

# Replace $variables in the .rst files if on a readthedocs worker
if "/home/docs/checkouts" in " ".join(sys.argv):
mss_search = subprocess.run(["conda", "search", "-c", "conda-forge", "mss"], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, encoding="utf8").stdout
# mss_search is inside a code block, reflect indentation
mss_search = (" " * 3).join([line for line in mss_search.splitlines(True) if line.startswith("mss ")][-2:])

for file in os.listdir():
if file.endswith(".rst"):
with open(file, "r") as rst:
content = Template(rst.read())
with open(file, "w") as rst:
rst.write(content.safe_substitute(mss_version=version[:-1] if version[-1] == "." else version,
mss_search=mss_search))

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
Expand Down
142 changes: 125 additions & 17 deletions docs/development.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _development:


===========
Development
============================
===========

This chapter will get you started with MSS development.

Expand Down Expand Up @@ -30,13 +30,85 @@ Output and Logging
When writing logger calls, always use correct log level (debug only for debugging, info for informative messages,
warning for warnings, error for errors, critical for critical errors/states).

Setup a development environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setting Up a Local Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to contribute make a fork on github of `MSS <https://github.com/Open-MSS/MSS>`_.
Requirements
------------

In the mss package is some demodata included. The default where this is stored is $HOME/mss. Your clone of the
MSS repository needs a different folder, e.g. workspace/mss. Avoid to mix data and source.
1. System requirements

| Any system with basic configuration.
| Operating System : Any (Windows / Linux / Mac).
2. Software requirement

| Python
| `Additional Requirements <https://github.com/Open-MSS/MSS/blob/develop/requirements.d/development.txt>`_

3. Skill set

| Knowledge of git & github
| python
Forking the Repo
----------------

1. Firstly you have to make your own copy of project. For that you have to fork the repository. You can find the fork button on the top-right side of the browser window.

2. Kindly wait till it gets forked.

3. After that copy will look like *<your-user-name>/MSS* forked from *Open-MSS/MSS*.

Cloning the Repo
----------------

1. Now you have your own copy of project. Here you have to start your work.

2. Go to desired location on your computer where you want to set-up the project.

3. Right click there and click on git bash. A terminal window will pop up

4. Click The big green button which says "Code". Copy the URL. `Like this <https://user-images.githubusercontent.com/71402528/122255281-9a855d80-ceeb-11eb-9f85-fed38db30562.png>`_

5. Now Type the command ``git clone <your-fork-url>.git`` and hit enter.

6. Wait for few seconds till the project gets copied

or simply head over here for `cloning a repository <https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository>`_

7. Add the path of your local cloned mss directory to $PYTHONPATH.

Setting up a git remote
-----------------------

1. Now you have to set up remote repositories

2. Type ``git remote -v`` in terminal to list remote connections to your repo.

3. It will show something like this:

``origin https://github.com/<your-user-name>/MSS.git`` (fetch)

``origin https://github.com/<your-user-name>/MSS.git`` (push)

4. Now type the command git remote add upstream ``https://github.com/Open-MSS/MSS.git`` this will set upstream as main directory

5. Again type in command git remote -v to check if remote has been set up correctly

6. It should show something like this :

``origin https://github.com/<your-user-name>/MSS.git`` (fetch)

``origin https://github.com/<your-user-name>/MSS.git`` (push)

upstream ``https://github.com/Open-MSS/MSS.git`` (fetch)

upstream ``https://github.com/Open-MSS/MSS.git`` (push)

Installing dependencies
-----------------------

MSS is based on the software of the conda-forge channel located, so we have to add this channel to the default::

Expand All @@ -53,26 +125,54 @@ Create an environment and install the whole mss package dependencies then remove

$ conda create -n mssdev mamba
$ conda activate mssdev
$ mamba install mss --only-deps
$ mamba install mss=$mss_version --only-deps

You can also use conda to install mss, but mamba is a way faster.
Compare versions used in the meta.yaml between stable and develop branch and apply needed changes.

Add the path of your local cloned mss directory to $PYTHONPATH.
Pushing your changes
--------------------

For developer we provide additional packages for running tests, activate your env and run::
1. Now you have made the changes, tested them and built them. So now it's time to push them.
2. Goto your terminal and type git status and hit enter, this will show your changes from the files
3. Then type in git add and hit enter, this will add all the files to staging area
4. Commit the changes by ``git commit -m "<message-describing-your-change>"`` and hit enter.
5. Now push your branch to your fork by ``git push origin <your-branch-name>`` and hit enter.

$ mamba install --file requirements.d/development.txt

On linux install the `conda package pyvirtualdisplay` and `xvfb` from your linux package manager.
This is used to run tests on a virtual display.
If you don't want tests redirected to the xvfb display just setup an environment variable::
Creating a pull request
-----------------------

$ export TESTS_VISIBLE=TRUE
By this time you can see a message on your github fork as your fork is ahead of Open-MSS:develop by <number> of commits and also you can see a button called Compare and pull request.

Click on Compare and pull request button.

You will see a template.

Fill out the template completely by describing your change, cause of change, issue getting fixed etc.

After filling the template completely click on Pull request

How to Report Bugs
~~~~~~~~~~~~~~~~~~

Please open a new issue in the appropriate GitHub repository `here <https://github.com/Open-MSS/MSS/issues/new>`_ with steps to reproduce the problem you're experiencing.

Be sure to include as much information including screenshots, text output, and both your expected and actual results.

How to Request Enhancements
~~~~~~~~~~~~~~~~~~~~~~~~~~~

First, please refer to the applicable `GitHub repository <https://github.com/Open-MSS/MSS>`_ and search `the repository's GitHub issues <https://github.com/Open-MSS/MSS/issues>`_ to make sure your idea has not been (or is not still) considered.

Then, please `create a new issue <https://github.com/Open-MSS/MSS/issues/new>`_ in the GitHub repository describing your enhancement.

Be sure to include as much detail as possible including step-by-step descriptions, specific examples, screenshots or mockups, and reasoning for why the enhancement might be worthwhile.

Setup demodata
~~~~~~~~~~~~~~
In the mss package is some demodata included. The default where this is stored is $HOME/mss. Your clone of the
MSS repository needs a different folder, e.g. workspace/mss. Avoid to mix data and source.

:ref:`demodata` is provided by executing::

Expand Down Expand Up @@ -104,6 +204,15 @@ Now you can use the MSS desktop application to connect to it using the Mscolab w

Running tests
~~~~~~~~~~~~~~~~~~~
For developers we provide additional packages for running tests, activate your env and run::

$ mamba install --file requirements.d/development.txt

On linux install the `conda package pyvirtualdisplay` and `xvfb` from your linux package manager.
This is used to run tests on a virtual display.
If you don't want tests redirected to the xvfb display just setup an environment variable::

$ export TESTS_VISIBLE=TRUE

We have implemented demodata as data base for testing. On first call of pytest a set of demodata becomes stored
in a /tmp/mss* folder. If you have installed gitpython a postfix of the revision head is added.
Expand Down Expand Up @@ -190,7 +299,7 @@ If you don't have a stable branch, create one first or change to that branch::
Merging stable into develop
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bug fixes we have done in stable we need to merge regulary into develop too::
Bug fixes we have done in stable we need to merge regulary into develop too::

git checkout stable
git pull git@github.com:Open-MSS/MSS.git stable
Expand Down Expand Up @@ -255,4 +364,3 @@ Publish on Conda Forge
* rerender the feedstock by conda smithy
* send a pull request
* maintainer will merge if there is no error

26 changes: 26 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
channels:
- conda-forge
- default
- defaults
dependencies:
- pip
- pip:
- flask
- flask-httpauth
- chameleon
- multidict
- isodate
- scipy
- metpy
- markdown
- xstatic
- defusedxml
- sphinx_rtd_theme
- sphinx
- fs
- netCDF4
- future
- pint
- PyQt5
- owslib
- basemap
Loading

0 comments on commit 19faae6

Please sign in to comment.