Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Jan 12, 2025
1 parent d8bc035 commit fe9546d
Show file tree
Hide file tree
Showing 15 changed files with 845 additions and 190 deletions.
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ Primary Dependencies

**Colour - CLF IO** requires various dependencies in order to run:

- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__
- `python >= 3.10, < 4 <https://www.python.org/download/releases>`__
- `lxml >= 5.2.1 < 6 <https://pypi.org/project/lxml/>`__
- `numpy >= 1.22, < 2 <https://pypi.org/project/numpy>`__
- `numpy >= 1.24, < 2 <https://pypi.org/project/numpy>`__

Pypi
~~~~
Expand Down Expand Up @@ -161,7 +161,8 @@ The *Colour Developers* can be reached via different means:
- `Facebook <https://www.facebook.com/python.colour.science>`__
- `Github Discussions <https://github.com/colour-science/colour-clf-io/discussions>`__
- `Gitter <https://gitter.im/colour-science/colour>`__
- `Twitter <https://twitter.com/colour_science>`__
- `X <https://x.com/colour_science>`__
- `Bluesky <https://bsky.app/profile/colour-science.bsky.social>`__

About
-----
Expand Down
26 changes: 14 additions & 12 deletions colour_clf_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
CLF Parsing
===========
Defines the functionality and data structures to parse CLF documents.
Defines the functionality and data structures to parse *CLF* files.
The main functionality is exposed through the following two methods:
- :func:`colour.io.clf.read_clf`: Read a file in the CLF format and return the
- :func:`colour.io.clf.read_clf`: Read a file in the *CLF* format and return the
corresponding :class: ProcessList.
- :func:`colour.io.clf.parse_clf`: Read a string that contains a CLF document and
- :func:`colour.io.clf.parse_clf`: Read a string that contains a *CLF* file and
return the corresponding :class: ProcessList.
References
Expand Down Expand Up @@ -106,7 +106,7 @@

def read_clf(path: str | Path) -> ProcessList | None:
"""
Read given *CLF* file and return the resulting `ProcessList`.
Read given *CLF* file and return a *ProcessList*.
Parameters
----------
Expand All @@ -115,12 +115,13 @@ def read_clf(path: str | Path) -> ProcessList | None:
Returns
-------
:class: colour.clf.ProcessList
:class:`colour_clf_io.ProcessList`
*ProcessList*.
Raises
------
:class: ParsingError
If the given file does not contain a valid CLF document.
:class:`colour_clf_io.errors.ParsingError`
If the given file does not contain a valid *CLF* file.
"""

xml = lxml.etree.parse(str(path)) # noqa: S320
Expand All @@ -131,21 +132,22 @@ def read_clf(path: str | Path) -> ProcessList | None:

def parse_clf(text: str | bytes) -> ProcessList | None:
"""
Read given string as a *CLF* document and return the resulting `ProcessList`.
Read given string as a *CLF* file and return a *ProcessList*.
Parameters
----------
text
String that contains the *CLF* document.
String that contains the *CLF* file.
Returns
-------
:class: colour.clf.ProcessList.
:class:`colour_clf_io.ProcessList`
*ProcessList*.
Raises
------
:class: ParsingError
If the given string does not contain a valid CLF document.
:class:`colour_clf_io.errors.ParsingError`
If the given string does not contain a valid *CLF* file.
"""

xml = lxml.etree.fromstring(text) # noqa: S320
Expand Down
Loading

0 comments on commit fe9546d

Please sign in to comment.