Skip to content

Commit

Permalink
docs: update development documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnhan committed Apr 9, 2024
1 parent c0ca81d commit 38efae6
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 11 deletions.
39 changes: 33 additions & 6 deletions docs/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,38 @@ review.
Code standards
==============

Import sorting, formatting, and linting are enforced with `Ruff
<https://github.com/astral-sh/ruff>`_. If you wish to contribute, using
`pre-commit <https://pre-commit.com>`_ is recommended. This will ensure that
your code is properly formatted before you commit it. A pre-commit configuration
file for ruff is included in the repository.
- Import sorting, formatting, and linting are enforced with `Ruff
<https://github.com/astral-sh/ruff>`_.

- If you wish to contribute, using `pre-commit <https://pre-commit.com>`_ is
recommended. This will ensure that your code is properly formatted before you
commit it. A pre-commit configuration file for ruff is included in the
repository.

- When writing code that uses Qt, please adhere to the following rules:

* Import all Qt bindings from `qtpy <https://github.com/spyder-ide/qtpy>`_,
and only import the top level modules: ::

from qtpy import QtWidgets, QtCore, QtGui

* Use fully qualified enum names from Qt6 instead of the short-form enums from
Qt5, i. e., ``QtCore.Qt.CheckState.Checked`` instead of
``QtCore.Qt.Checked``.

* Use the signal and slot syntax from PySide6 (``QtCore.Signal`` and
``QtCore.Slot`` instead of ``QtCore.pyqtSignal`` and ``QtCore.pyqtSlot``)

* When using Qt Designer, place ``.ui`` files in the same directory as the
Python file that uses them. The files must be imported using the
``loadUiType`` function from ``qtpy.uic``. For example: ::

from qtpy import uic

class MyWidget(*uic.loadUiType(os.path.join(os.path.dirname(__file__), "mywidget.ui"))):
def __init__(self):
super().__init__()
self.setupUi(self)

Documentation
=============
Expand All @@ -278,7 +305,7 @@ well.

Some other important things to know about the docs:

- The *erlabpy* documentation consists of two parts: the docstrings in the code
- The documentation consists of two parts: the docstrings in the code
itself and the docs in this folder ``erlabpy/docs/source/``.

The docstrings are meant to provide a clear explanation of the usage of the
Expand Down
13 changes: 12 additions & 1 deletion docs/source/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ are sufficient for most use cases.
* - `pyqtgraph <https://pyqtgraph.readthedocs.io/en/latest/>`_
- Interactive plotting (i.e., imagetool)

For the full list of dependencies, see the `requirements.txt` file.
ERLabPy also requires a Qt library such as PyQt5, PyQt6, PySide2, or PySide6. To
ensure compatibility and keep the namespace clean, ERLabPy imports Qt bindings
from `qtpy <https://github.com/spyder-ide/qtpy>`_, which will automatically
select the appropriate library based on what is installed.

See the :doc:`userguide` to start using ERLabPy!

Expand Down Expand Up @@ -90,3 +93,11 @@ listed just for convenience.
`cmocean <https://matplotlib.org/cmocean/>`_, and
`colorcet <https://colorcet.holoviz.org>`_
- More colormaps!

For a full list of dependencies and optional dependencies, take a look at the ``[project]`` and ``[project.optional-dependencies]`` section in
``pyproject.toml``:

.. literalinclude:: ../../pyproject.toml
:language: toml
:start-at: dependencies = [
:end-before: [project.urls]
25 changes: 21 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
]
dynamic = ["version"]
dependencies = [
"h5netcdf>=1.2.0",
"igor2>=0.5.6",
Expand All @@ -42,17 +43,33 @@ dependencies = [
"varname>=0.13.0",
"xarray>=2024.02.0",
]
dynamic = ["version"]

[project.optional-dependencies]
docs = [
"sphinx",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
"sphinxcontrib-bibtex",
"pybtex",
"nbsphinx",
"furo",
"sphinx-design",
]
dev = [
"pytest",
"pytest-xdist",
"python-semantic-release",
"ruff",
"pre-commit",
]
viz = ["cmasher", "cmocean", "colorcet", "hvplot"]

[project.urls]
Documentation = "https://erlabpy.readthedocs.io"
Repository = "https://github.com/kmnhan/erlabpy.git"
Issues = "https://github.com/kmnhan/erlabpy/issues"
Changelog = "https://github.com/kmnhan/erlabpy/blob/main/CHANGELOG.md"

[project.optional-dependencies]
dev = ["pytest", "python-semantic-release", "ruff", "pre-commit"]

[tool.setuptools]
package-dir = { "" = "src" }

Expand Down

0 comments on commit 38efae6

Please sign in to comment.