Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda package for MPAS tools #248

Merged
merged 27 commits into from
May 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8ed7c1a
Fix print statements for python 3
xylar Mar 7, 2019
4494c51
Fix PEP8 formatting of coastline alteration scripts
xylar Mar 7, 2019
b9f1191
Move conda recipe to mesh_tools
xylar Feb 25, 2019
ce3a27f
Add LICENSE file
xylar Feb 25, 2019
6c65a4b
Add mpas_mesh_tools python package
xylar Feb 25, 2019
2d69688
Fix is_periodic if both --npx and --npy are used
xylar May 6, 2019
30f9945
Update conda recipe to include mpas_mesh_tools package
xylar Feb 25, 2019
832df95
Update setup.py and conda recipe
xylar Feb 26, 2019
187d4f7
Fix PEP8 formatting on mark_horns_for_culling.py
xylar Feb 26, 2019
97bbedd
Update the recipe to move land ice mesh tools
xylar Feb 27, 2019
2accb0d
Add translate and io to mpas_mesh_tools
xylar Mar 2, 2019
ee3d53c
Fix the conda recipe
xylar Mar 2, 2019
dab0c32
Add more scripts needed for COMPASS
xylar Mar 7, 2019
cd61743
Add python function to interface with mesh conversion tools
xylar Mar 16, 2019
bb8f187
Update gitignore to ignore many more unwanted files/dirs
xylar Mar 16, 2019
4000fab
Add a starting point for MPAS mesh-tool documentation
xylar Mar 18, 2019
8a49167
Move mpas_mesh_tools up a directory
xylar Apr 25, 2019
ac8c01c
Add the paraview extractor to mpas_mesh_tools
xylar Apr 25, 2019
05defe2
Rename mpas_mesh_tools to just mpas_tools
xylar Apr 28, 2019
a4051f9
Update 2 coastal-alteration tools to be functions
xylar Apr 28, 2019
fa33182
Switch conversion to using a temp directory
xylar Apr 29, 2019
93dd159
Add option to set NetCDF format
xylar Apr 29, 2019
6516c7e
Move mpas_tools package into conda_package
xylar May 3, 2019
061bc4b
Make add_land_locked_cells_to_mask a function
xylar May 3, 2019
bde3e5d
Change add_land_locked_cells_to_mask to use xarray
xylar May 3, 2019
4efecfc
Add test for non-periodic planar-hex meshes
xylar May 6, 2019
eb25e77
Add support for lists of masks for the conda-package cell culler
xylar May 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,95 @@
*.png

# Each tool should also have it's own .gitignore file that ignores the build files for that tool.

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

.DS_Store
39 changes: 39 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Copyright (c) 2013-2018, Los Alamos National Security, LLC (LANS) (Ocean: LA-CC-13-047;
Land Ice: LA-CC-13-117) and the University Corporation for Atmospheric Research (UCAR).

All rights reserved.

LANS is the operator of the Los Alamos National Laboratory under Contract No.
DE-AC52-06NA25396 with the U.S. Department of Energy. UCAR manages the National
Center for Atmospheric Research under Cooperative Agreement ATM-0753581 with the
National Science Foundation. The U.S. Government has rights to use, reproduce,
and distribute this software. NO WARRANTY, EXPRESS OR IMPLIED IS OFFERED BY
LANS, UCAR OR THE GOVERNMENT AND NONE OF THEM ASSUME ANY LIABILITY FOR THE USE
OF THIS SOFTWARE. If software is modified to produce derivative works, such
modified software should be clearly marked, so as not to confuse it with the
version available from LANS and UCAR.

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

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

2) 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.

3) None of the names of LANS, UCAR or the names of its contributors, if any, 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 LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 changes: 24 additions & 0 deletions conda_package/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = mpas_tools
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
rm -rf *obs_table.rst generated obs
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
55 changes: 55 additions & 0 deletions conda_package/docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#############
API reference
#############

This page provides an auto-generated summary of the MPAS mesh-tools API. For
more details and examples, refer to the relevant chapters in the main part of
the documentation.

MPAS mesh tools
===============

.. currentmodule:: mpas_tools.planar_hex

.. autosummary::
:toctree: generated/

make_periodic_planar_hex_mesh

.. currentmodule:: mpas_tools.translate

.. autosummary::
:toctree: generated/

translate


.. currentmodule:: mpas_tools.conversion

.. autosummary::
:toctree: generated/

convert
cull
mask


.. currentmodule:: mpas_tools.io

.. autosummary::
:toctree: generated/

write_netcdf


Ocean Tools
===========

.. currentmodule:: mpas_tools.ocean.coastline_alteration

.. autosummary::
:toctree: generated/

add_critical_land_blockages
widen_transect_edge_masks

180 changes: 180 additions & 0 deletions conda_package/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# -*- coding: utf-8 -*-
#
# mpas_tools documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 25 14:39:11 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import mpas_tools

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'numpydoc']

autosummary_generate = True

numpydoc_class_members_toctree = True
numpydoc_show_class_members = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst']
# source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'mpas_tools'
copyright = u'This software is open source software available under the BSD-3' \
u'license. Copyright (c) 2019 Triad National Security, LLC. ' \
u'All rights reserved. Copyright (c) 2018 Lawrence Livermore ' \
u'National Security, LLC. All rights reserved. Copyright (c) ' \
u'2018 UT-Battelle, LLC. All rights reserved.'
author = u'Xylar Asay-Davis, Doug Jacobsen, Michael Duda, Mark Petersen, ' \
u'Matt Hoffman, Adridan Turner, Philip Wolfram'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'0.0.1'
# The full version, including alpha/beta/rc tags.
release = u'0.0.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store',
'design_docs/template.md']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from
# docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'mpas_tools_doc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'mpas_tools.tex', u'mpas_tools Documentation',
author, 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'mpas_tools', u'mpas_tools Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'mpas_tools', u'mpas_tools Documentation',
author, 'mpas_tools', 'One line description of project.',
'Miscellaneous'),
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/', None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'xarray': ('http://xarray.pydata.org/en/stable/', None)}


github_doc_root = 'https://github.com/rtfd/recommonmark/tree/master/doc/'
Loading