Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
f-brinkmann committed Mar 15, 2024
2 parents 65465b0 + bfd3719 commit 2eea379
Show file tree
Hide file tree
Showing 17 changed files with 4,067 additions and 4,091 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ workflows:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- flake:
matrix:
parameters:
Expand Down Expand Up @@ -196,6 +197,7 @@ workflows:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
filters:
branches:
ignore: /.*/
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Ready to contribute? Here's how to set up `pyfar` for local development using th
$ flake8 pyfar tests
$ pytest

flake8 test must pass without any warnings for `./pyfar` and `./tests` using the default or a stricter configuration. Flake8 ignores `E123/E133, E226` and `E241/E242` by default. If necessary adjust the your flake8 and linting configuration in your IDE accordingly.
flake8 test must pass without any warnings for `./pyfar` and `./tests` using the default or a stricter configuration. Flake8 ignores `E123/E133, E226` and `E241/E242` by default. If necessary adjust your flake8 and linting configuration in your IDE accordingly.

6. Commit your changes and push your branch to GitHub::

Expand Down Expand Up @@ -207,7 +207,7 @@ Here are a few tips to make things run smoothly
- Use ``[#]_`` and ``.. [#]`` to get automatically numbered footnotes.
- Do not use footnotes in the short summary. Only use footnotes in the extended summary if there is a short summary. Otherwise, it messes with the auto-footnotes.
- If a method or class takes or returns pyfar objects for example write ``parameter_name : Signal``. This will create a link to the ``pyfar.Signal`` class.
- Plots can be included in by using the prefix ``.. plot::`` followed by an empty line and an indented block containing the code for the plot. See `pyfar.plot.line.time.py` for examples.
- Plots can be included in the documentation by using the prefix ``.. plot::`` followed by an empty line and an indented block containing the code for the plot. See `pyfar.plot.line.time.py` for examples.

See the `Sphinx homepage <https://www.sphinx-doc.org>`_ for more information.

Expand Down
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
History
=======

0.6.5 (2024-03-15)
------------------
* `Coordinates.show` now plots on equally scaled axis (PR #554)
* Update documentation to pydata theme (PR #560)
* Improve documentation (PR #544, #548, #549, #556)
* Add testing for Python 3.12 (PR #561)

0.6.4 (2024-02-16)
------------------
* Bugfix in `pyfar.io.read_comsol_header`: Fix for reading expressions containing the characters '-', '[', and ']' (PR #535)
Expand Down
8 changes: 8 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

html[data-theme="light"] {
--pst-color-primary: #18609d; /* pyfar blue as primary color */
}

html[data-theme="dark"] {
--pst-color-primary: #18609d; /* pyfar blue as primary color */
}
Binary file added docs/_static/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions docs/_templates/navbar-nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<div class="navbar-item">
<nav class="navbar-nav">
<ul class="bd-navbar-elements navbar-nav">

<li class="nav-item">
<a class="nav-link" href="https://pyfar-gallery.readthedocs.io/en/latest/">
Home
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://pyfar-gallery.readthedocs.io/en/latest/examples_gallery.html">
Examples
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://pyfar.readthedocs.io/en/stable/">
pyfar
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://sofar.readthedocs.io/en/stable/">
sofar
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://spharpy.readthedocs.io/en/latest/">
spharpy
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://pyrato.readthedocs.io/en/latest/">
pyrato
</a>
</li>
</ul>
</nav></div>
7,887 changes: 3,935 additions & 3,952 deletions docs/concepts/resources/coordinate_systems.ai

Large diffs are not rendered by default.

Binary file modified docs/concepts/resources/coordinate_systems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
161 changes: 48 additions & 113 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
#
# pyfar documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 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.
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

import pyfar # noqa

# -- General configuration ---------------------------------------------
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#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.viewcode',
Expand All @@ -40,7 +23,10 @@
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'autodocsumm']
'autodocsumm',
'sphinx_design',
'sphinx_favicon',
]

# show tocs for classes and functions of modules using the autodocsumm
# package
Expand All @@ -51,21 +37,19 @@
plot_include_source = True

# 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_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'pyfar'
copyright = u"2020-2022, The pyfar developers"
author = u"The pyfar developers"
project = 'pyfar'
copyright = '2020, The pyfar developers'
author = 'The pyfar developers'

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
Expand All @@ -76,9 +60,6 @@
# The full version, including alpha/beta/rc tags.
release = pyfar.__version__

# 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 = 'en'
Expand Down Expand Up @@ -109,86 +90,40 @@
'spharpy': ('https://spharpy.readthedocs.io/en/stable/', None)
}

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

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

# 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 = 'pyfardoc'


# -- 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',
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
html_css_files = ['css/custom.css']
html_logo = 'resources/logos/pyfar_logos_fixed_size_pyfar.png'
html_title = "pyfar"
html_favicon = '_static/favicon.ico'

# -- HTML theme options
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html

html_theme_options = {
"navbar_start": ["navbar-logo"],
"navbar_end": ["navbar-icon-links", "theme-switcher"],
"navbar_align": "content",
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/pyfar",
"icon": "fa-brands fa-square-github",
"type": "fontawesome",
},
],
# Configure secondary (right) side bar
"show_toc_level": 3, # Show all subsections of notebooks
"secondary_sidebar_items": ["page-toc"], # Omit 'show source' link that that shows notebook in json format
"navigation_with_keys": True,
}

# 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, 'pyfar.tex',
u'pyfar Documentation',
u'Marco Berzborn', '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, 'pyfar',
u'pyfar 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, 'pyfar',
u'pyfar Documentation',
author,
'pyfar',
'One line description of project.',
'Miscellaneous'),
]

html_context = {
"default_mode": "light"
}

# -- pyfar specifics -----------------------------------------------------

Expand Down
5 changes: 1 addition & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
:width: 150
:alt: Alternative text

|pyfar_logo|


Getting Started
===============

Expand Down Expand Up @@ -35,7 +32,7 @@ Contributing
===============

.. toctree::
:maxdepth: 2
:maxdepth: 1

contributing

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyfar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """The pyfar developers"""
__email__ = ''
__version__ = '0.6.4'
__version__ = '0.6.5'


from .classes.audio import Signal, TimeData, FrequencyData
Expand Down
7 changes: 4 additions & 3 deletions pyfar/_concepts/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
Coordinate Systems
------------------
Coordinate systems are defined by their `domain` (e.g. ``'spherical'``),
`convention` (e.g. ``'top_elev'``), and `unit` (e.g. ``'deg'``). The available
coordinate systems are shown in the image below
Coordinate systems are defined by their domain (cartesian, spherical,
cylindrical), and, if multiple definitions of the domain exist, also by
their convention. The available coordinate systems are shown
in the image below
|coordinate_systems|
Expand Down
23 changes: 11 additions & 12 deletions pyfar/classes/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,12 +1399,20 @@ def show(self, mask=None, **kwargs):
"""
if mask is None:
pf.plot.scatter(self, **kwargs)
ax = pf.plot.scatter(self, **kwargs)
else:
mask = np.asarray(mask)
colors = np.full(self.cshape, pf.plot.color('b'))
colors[mask] = pf.plot.color('r')
pf.plot.scatter(self, c=colors.flatten(), **kwargs)
ax = pf.plot.scatter(self, c=colors.flatten(), **kwargs)

ax.set_box_aspect([
np.ptp(self.x),
np.ptp(self.y),
np.ptp(self.z)])
ax.set_aspect('equal')

return ax

def find_nearest(self, find, k=1, distance_measure='euclidean'):
"""
Expand Down Expand Up @@ -2651,17 +2659,8 @@ def __repr__(self):
else:
obj = "Empty Coordinates object"

# coordinate convention
conv = "domain: {}, convention: {}, unit: {}".format(
self._system['domain'], self._system['convention'],
self._system['unit'])

# coordinates and units
coords = ["{} in {}".format(c, u) for c, u in
zip(self._system['coordinates'], self._system['units'])]

# join information
_repr = obj + "\n" + conv + "\n" + "coordinates: " + ", ".join(coords)
_repr = obj + "\n"

# check for sampling weights
if self._weights is None:
Expand Down
Loading

0 comments on commit 2eea379

Please sign in to comment.