Skip to content

Commit 8948389

Browse files
authored
Merge pull request #248 from xylar/mesh_tools_conda_package
conda package for MPAS tools This package is intended to include all the tools needed to run run COMPASS test cases and other typical mesh creation workflows. This includes: * the mesh conversion tools (#243) * a python interface to the mesh conversion tools * the planar hex creation tool (#246) * a modified version of the mesh translation tool (python 3 compatible and callable as a function as well as a script * 4 land-ice mesh tools (updated for python 3) * 3 ocean coastal modification scripts (now available as functions and updated for python 3) * add a copy of the MPAS-Model license (a license is required for conda-forge packages) * a starting point for documentation
2 parents fed2fdc + eb25e77 commit 8948389

29 files changed

+1634
-477
lines changed

.gitignore

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,95 @@
99
*.png
1010

1111
# Each tool should also have it's own .gitignore file that ignores the build files for that tool.
12+
13+
# Byte-compiled / optimized / DLL files
14+
__pycache__/
15+
*.py[cod]
16+
*$py.class
17+
18+
# C extensions
19+
*.so
20+
21+
# Distribution / packaging
22+
.Python
23+
env/
24+
build/
25+
develop-eggs/
26+
dist/
27+
downloads/
28+
eggs/
29+
.eggs/
30+
lib/
31+
lib64/
32+
parts/
33+
sdist/
34+
var/
35+
*.egg-info/
36+
.installed.cfg
37+
*.egg
38+
39+
# PyInstaller
40+
# Usually these files are written by a python script from a template
41+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
42+
*.manifest
43+
*.spec
44+
45+
# Installer logs
46+
pip-log.txt
47+
pip-delete-this-directory.txt
48+
49+
# Unit test / coverage reports
50+
htmlcov/
51+
.tox/
52+
.coverage
53+
.coverage.*
54+
.cache
55+
nosetests.xml
56+
coverage.xml
57+
*,cover
58+
.hypothesis/
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
target/
80+
81+
# IPython Notebook
82+
.ipynb_checkpoints
83+
84+
# pyenv
85+
.python-version
86+
87+
# celery beat schedule file
88+
celerybeat-schedule
89+
90+
# dotenv
91+
.env
92+
93+
# virtualenv
94+
venv/
95+
ENV/
96+
97+
# Spyder project settings
98+
.spyderproject
99+
100+
# Rope project settings
101+
.ropeproject
102+
103+
.DS_Store

LICENSE

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Copyright (c) 2013-2018, Los Alamos National Security, LLC (LANS) (Ocean: LA-CC-13-047;
2+
Land Ice: LA-CC-13-117) and the University Corporation for Atmospheric Research (UCAR).
3+
4+
All rights reserved.
5+
6+
LANS is the operator of the Los Alamos National Laboratory under Contract No.
7+
DE-AC52-06NA25396 with the U.S. Department of Energy. UCAR manages the National
8+
Center for Atmospheric Research under Cooperative Agreement ATM-0753581 with the
9+
National Science Foundation. The U.S. Government has rights to use, reproduce,
10+
and distribute this software. NO WARRANTY, EXPRESS OR IMPLIED IS OFFERED BY
11+
LANS, UCAR OR THE GOVERNMENT AND NONE OF THEM ASSUME ANY LIABILITY FOR THE USE
12+
OF THIS SOFTWARE. If software is modified to produce derivative works, such
13+
modified software should be clearly marked, so as not to confuse it with the
14+
version available from LANS and UCAR.
15+
16+
Additionally, redistribution and use in source and binary forms, with or without
17+
modification, are permitted provided that the following conditions are met:
18+
19+
1) Redistributions of source code must retain the above copyright notice, this
20+
list of conditions and the following disclaimer.
21+
22+
2) Redistributions in binary form must reproduce the above copyright notice,
23+
this list of conditions and the following disclaimer in the documentation and/or
24+
other materials provided with the distribution.
25+
26+
3) None of the names of LANS, UCAR or the names of its contributors, if any, may
27+
be used to endorse or promote products derived from this software without
28+
specific prior written permission.
29+
30+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
31+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
32+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
34+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
35+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
37+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

conda_package/docs/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = mpas_tools
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
clean:
16+
rm -rf *obs_table.rst generated obs
17+
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18+
19+
.PHONY: help Makefile
20+
21+
# Catch-all target: route all unknown targets to Sphinx using the new
22+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
23+
%: Makefile
24+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

conda_package/docs/api.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#############
2+
API reference
3+
#############
4+
5+
This page provides an auto-generated summary of the MPAS mesh-tools API. For
6+
more details and examples, refer to the relevant chapters in the main part of
7+
the documentation.
8+
9+
MPAS mesh tools
10+
===============
11+
12+
.. currentmodule:: mpas_tools.planar_hex
13+
14+
.. autosummary::
15+
:toctree: generated/
16+
17+
make_periodic_planar_hex_mesh
18+
19+
.. currentmodule:: mpas_tools.translate
20+
21+
.. autosummary::
22+
:toctree: generated/
23+
24+
translate
25+
26+
27+
.. currentmodule:: mpas_tools.conversion
28+
29+
.. autosummary::
30+
:toctree: generated/
31+
32+
convert
33+
cull
34+
mask
35+
36+
37+
.. currentmodule:: mpas_tools.io
38+
39+
.. autosummary::
40+
:toctree: generated/
41+
42+
write_netcdf
43+
44+
45+
Ocean Tools
46+
===========
47+
48+
.. currentmodule:: mpas_tools.ocean.coastline_alteration
49+
50+
.. autosummary::
51+
:toctree: generated/
52+
53+
add_critical_land_blockages
54+
widen_transect_edge_masks
55+

conda_package/docs/conf.py

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# mpas_tools documentation build configuration file, created by
4+
# sphinx-quickstart on Sat Mar 25 14:39:11 2017.
5+
#
6+
# This file is execfile()d with the current directory set to its
7+
# containing dir.
8+
#
9+
# Note that not all possible configuration values are present in this
10+
# autogenerated file.
11+
#
12+
# All configuration values have a default; values that are commented out
13+
# serve to show the default.
14+
15+
import os
16+
import mpas_tools
17+
18+
# -- General configuration ------------------------------------------------
19+
20+
# If your documentation needs a minimal Sphinx version, state it here.
21+
#
22+
# needs_sphinx = '1.0'
23+
24+
# Add any Sphinx extension module names here, as strings. They can be
25+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
26+
# ones.
27+
extensions = ['sphinx.ext.autodoc',
28+
'sphinx.ext.autosummary',
29+
'sphinx.ext.intersphinx',
30+
'sphinx.ext.mathjax',
31+
'sphinx.ext.viewcode',
32+
'numpydoc']
33+
34+
autosummary_generate = True
35+
36+
numpydoc_class_members_toctree = True
37+
numpydoc_show_class_members = False
38+
39+
# Add any paths that contain templates here, relative to this directory.
40+
templates_path = ['_templates']
41+
42+
# The suffix(es) of source filenames.
43+
# You can specify multiple suffix as a list of string:
44+
#
45+
source_suffix = ['.rst']
46+
# source_suffix = '.rst'
47+
48+
# The master toctree document.
49+
master_doc = 'index'
50+
51+
# General information about the project.
52+
project = u'mpas_tools'
53+
copyright = u'This software is open source software available under the BSD-3' \
54+
u'license. Copyright (c) 2019 Triad National Security, LLC. ' \
55+
u'All rights reserved. Copyright (c) 2018 Lawrence Livermore ' \
56+
u'National Security, LLC. All rights reserved. Copyright (c) ' \
57+
u'2018 UT-Battelle, LLC. All rights reserved.'
58+
author = u'Xylar Asay-Davis, Doug Jacobsen, Michael Duda, Mark Petersen, ' \
59+
u'Matt Hoffman, Adridan Turner, Philip Wolfram'
60+
61+
# The version info for the project you're documenting, acts as replacement for
62+
# |version| and |release|, also used in various other places throughout the
63+
# built documents.
64+
#
65+
# The short X.Y version.
66+
version = u'0.0.1'
67+
# The full version, including alpha/beta/rc tags.
68+
release = u'0.0.1'
69+
70+
# The language for content autogenerated by Sphinx. Refer to documentation
71+
# for a list of supported languages.
72+
#
73+
# This is also used if you do content translation via gettext catalogs.
74+
# Usually you set "language" from the command line for these cases.
75+
language = None
76+
77+
# List of patterns, relative to source directory, that match files and
78+
# directories to ignore when looking for source files.
79+
# This patterns also effect to html_static_path and html_extra_path
80+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store',
81+
'design_docs/template.md']
82+
83+
# The name of the Pygments (syntax highlighting) style to use.
84+
pygments_style = 'sphinx'
85+
86+
# If true, `todo` and `todoList` produce output, else they produce nothing.
87+
todo_include_todos = False
88+
89+
90+
# -- Options for HTML output ----------------------------------------------
91+
92+
# The theme to use for HTML and HTML Help pages. See the documentation for
93+
# a list of builtin themes.
94+
#
95+
96+
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from
97+
# docs.readthedocs.org
98+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
99+
100+
if not on_rtd: # only import and set the theme if we're building docs locally
101+
import sphinx_rtd_theme
102+
html_theme = 'sphinx_rtd_theme'
103+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
104+
105+
# Theme options are theme-specific and customize the look and feel of a theme
106+
# further. For a list of options available for each theme, see the
107+
# documentation.
108+
#
109+
# html_theme_options = {}
110+
111+
# Add any paths that contain custom static files (such as style sheets) here,
112+
# relative to this directory. They are copied after the builtin static files,
113+
# so a file named "default.css" will overwrite the builtin "default.css".
114+
html_static_path = ['_static']
115+
116+
117+
# -- Options for HTMLHelp output ------------------------------------------
118+
119+
# Output file base name for HTML help builder.
120+
htmlhelp_basename = 'mpas_tools_doc'
121+
122+
123+
# -- Options for LaTeX output ---------------------------------------------
124+
125+
latex_elements = {
126+
# The paper size ('letterpaper' or 'a4paper').
127+
#
128+
# 'papersize': 'letterpaper',
129+
130+
# The font size ('10pt', '11pt' or '12pt').
131+
#
132+
# 'pointsize': '10pt',
133+
134+
# Additional stuff for the LaTeX preamble.
135+
#
136+
# 'preamble': '',
137+
138+
# Latex figure (float) alignment
139+
#
140+
# 'figure_align': 'htbp',
141+
}
142+
143+
# Grouping the document tree into LaTeX files. List of tuples
144+
# (source start file, target name, title,
145+
# author, documentclass [howto, manual, or own class]).
146+
latex_documents = [
147+
(master_doc, 'mpas_tools.tex', u'mpas_tools Documentation',
148+
author, 'manual'),
149+
]
150+
151+
152+
# -- Options for manual page output ---------------------------------------
153+
154+
# One entry per manual page. List of tuples
155+
# (source start file, name, description, authors, manual section).
156+
man_pages = [
157+
(master_doc, 'mpas_tools', u'mpas_tools Documentation',
158+
[author], 1)
159+
]
160+
161+
162+
# -- Options for Texinfo output -------------------------------------------
163+
164+
# Grouping the document tree into Texinfo files. List of tuples
165+
# (source start file, target name, title, author,
166+
# dir menu entry, description, category)
167+
texinfo_documents = [
168+
(master_doc, 'mpas_tools', u'mpas_tools Documentation',
169+
author, 'mpas_tools', 'One line description of project.',
170+
'Miscellaneous'),
171+
]
172+
173+
# Example configuration for intersphinx: refer to the Python standard library.
174+
intersphinx_mapping = {
175+
'python': ('https://docs.python.org/', None),
176+
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
177+
'xarray': ('http://xarray.pydata.org/en/stable/', None)}
178+
179+
180+
github_doc_root = 'https://github.com/rtfd/recommonmark/tree/master/doc/'

0 commit comments

Comments
 (0)