Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,17 @@ repos:
# clang-format

# Python Formatting
#- repo: https://github.com/psf/black
# rev: 21.10b0 # Keep in sync with blacken-docs
# hooks:
# - id: black
#- repo: https://github.com/asottile/blacken-docs
# rev: v1.11.0
# hooks:
# - id: blacken-docs
# additional_dependencies:
# - black==21.10b0 # keep in sync with black hook
- repo: https://github.com/psf/black
rev: 21.12b0 # Keep in sync with blacken-docs
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: v1.11.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==21.12b0 # keep in sync with black hook
- openpmd-api

# Checks the manifest for missing files (native support)
- repo: https://github.com/mgedmin/check-manifest
Expand Down
12 changes: 9 additions & 3 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ The old setter function (``set_data_order``) and read-only property (``data_orde

series = io.Series("data%T.h5", io.Access.read_only)
rho = series.iterations[0].meshes["rho"]
rho.data_order = 'C' # or 'F'
rho.data_order = "C" # or 'F'

print(rho.data_order == 'C') # True
print(rho.data_order == "C") # True

Note: we recommend using ``'C'`` order since version 2 of the openPMD-standard will simplify this option to ``'C'``, too.
For Fortran-ordered indices, please just invert the attributes ``axis_labels``, ``grid_spacing`` and ``grid_global_offset`` accordingly.
Expand Down Expand Up @@ -163,7 +163,13 @@ The new order allows to make use of defaults in many cases in order reduce compl
electrons["position"]["x"].reset_dataset(d)

# old code
electrons["position"]["x"].store_chunk([0, ], particlePos_x.shape, particlePos_x)
electrons["position"]["x"].store_chunk(
[
0,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
0,
0

],
particlePos_x.shape,
particlePos_x,
)

# new code
electrons["position"]["x"].store_chunk(particlePos_x)
Expand Down
6 changes: 2 additions & 4 deletions docs/source/citation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,5 @@ Python

import openpmd_api as io

print("openPMD-api: {}"
.format(io.__version__))
print("openPMD-api backend variants: {}"
.format(io.variants))
print("openPMD-api: {}".format(io.__version__))
print("openPMD-api backend variants: {}".format(io.variants))
98 changes: 54 additions & 44 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
import os
import subprocess
from recommonmark.parser import CommonMarkParser

# import sys
# sys.path.insert(0, os.path.abspath('.'))


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

# RTD
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

show_authors = True

Expand All @@ -34,58 +35,63 @@
# 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.mathjax',
'breathe',
'sphinxcontrib.programoutput',
'sphinxcontrib.rsvgconverter',
'matplotlib.sphinxext.plot_directive']
extensions = [
"sphinx.ext.mathjax",
"breathe",
"sphinxcontrib.programoutput",
"sphinxcontrib.rsvgconverter",
"matplotlib.sphinxext.plot_directive",
]

if not on_rtd:
extensions.append('sphinx.ext.githubpages')
extensions.append("sphinx.ext.githubpages")

# breathe config
breathe_projects = {'openPMD-api': '../xml'}
breathe_default_project = 'openPMD-api'
breathe_projects = {"openPMD-api": "../xml"}
breathe_default_project = "openPMD-api"

subprocess.call('cd ..; doxygen;'
'mkdir -p source/_static;'
'cp -r doxyhtml source/_static/;'
'cp openpmd-api-doxygen-web.tag.xml source/_static/doxyhtml/',
shell=True)
subprocess.call(
"cd ..; doxygen;"
"mkdir -p source/_static;"
"cp -r doxyhtml source/_static/;"
"cp openpmd-api-doxygen-web.tag.xml source/_static/doxyhtml/",
shell=True,
)

if not on_rtd:
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_parsers = {
'.md': CommonMarkParser,
".md": CommonMarkParser,
}

source_suffix = ['.rst', '.md']
source_suffix = [".rst", ".md"]

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'openPMD-api'
copyright = u'Documentation under CC-BY 4.0, The openPMD Community'
author = u'The openPMD Community'
project = u"openPMD-api"
copyright = u"Documentation under CC-BY 4.0, The openPMD Community"
author = u"The openPMD Community"

# 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.15.0'
version = u"0.15.0"
# The full version, including alpha/beta/rc tags.
release = u'0.15.0-dev'
release = u"0.15.0-dev"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -100,15 +106,15 @@
exclude_patterns = []

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

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


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

html_logo = 'openPMD.png'
html_logo = "openPMD.png"

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
Expand All @@ -124,34 +130,31 @@
# 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']
html_static_path = ["_static"]


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

# Output file base name for HTML help builder.
htmlhelp_basename = 'openPMD-apidoc'
htmlhelp_basename = "openPMD-apidoc"


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

latex_logo = 'openPMD.png'
latex_logo = "openPMD.png"

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

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

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
'preamble': r'\setcounter{tocdepth}{2}',

"preamble": r"\setcounter{tocdepth}{2}",
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -161,19 +164,21 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'openPMD-api.tex', u'openPMD-api Documentation',
u'The openPMD Community', 'manual'),
(
master_doc,
"openPMD-api.tex",
u"openPMD-api Documentation",
u"The openPMD Community",
"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, 'openPMD-api', u'openPMD-api Documentation',
[author], 1)
]
man_pages = [(master_doc, "openPMD-api", u"openPMD-api Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -182,14 +187,19 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'openPMD-api', u'openPMD-api Documentation',
author, 'openPMD-api',
'C++ and Python APIs for the openPMD meta-standard',
"""
(
master_doc,
"openPMD-api",
u"openPMD-api Documentation",
author,
"openPMD-api",
"C++ and Python APIs for the openPMD meta-standard",
"""
The openPMD standard, short for open standard for particle-mesh data files
is not a file format per se. It is a standard for meta data and naming
schemes.
openPMD provides naming and attribute conventions that allow to exchange
particle and mesh based data from scientific simulations and experiments.
"""),
""",
),
]
15 changes: 4 additions & 11 deletions docs/source/usage/firstread.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ Python

.. code-block:: python3

series = io.Series(
"data%T.h5",
io.Access.read_only)
series = io.Series("data%T.h5", io.Access.read_only)

Iteration
---------
Expand Down Expand Up @@ -142,12 +140,10 @@ Python

.. code-block:: python3

print("openPMD version: ",
series.openPMD)
print("openPMD version: ", series.openPMD)

if series.contains_attribute("author"):
print("Author: ",
series.author)
print("Author: ", series.author)

Record
------
Expand Down Expand Up @@ -328,10 +324,7 @@ Python

extent = E_x.shape

print(
"First values in E_x "
"of shape: ",
extent)
print("First values in E_x " "of shape: ", extent)


print(x_data[0, 0, :5])
Expand Down
Loading