Skip to content

Commit

Permalink
Docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKraus committed May 22, 2024
1 parent 2000eb3 commit 25e3974
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@
"dgbowl_schemas": ("https://dgbowl.github.io/dgbowl-schemas/master", None),
"xarray": ("https://docs.xarray.dev/en/stable", None),
"datatree": ("https://xarray-datatree.readthedocs.io/en/latest/", None),
"babel": ("https://babel.pocoo.org/en/latest/", None),
}
5 changes: 5 additions & 0 deletions docs/source/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Another key feature in **yadg** is the timestamping of all datapoints. The Unix
Most of the supported file formats contain a timestamp of some kind. However, several file formats may not define both date and time of each datapoint, or may define neither. That is why **yadg** includes a powerful "external date" interface, see :func:`~yadg.dgutils.dateutils.complete_timestamps`.


Locale support
``````````````
Support for parsing numbers in localized files is implemented in **yadg** via the :mod:`babel` library, allowing the users to specify the locale of the file using standard locale strings, such as ``en_US`` or ``de_CH``. This avoids "hacks" such as replacing decimal separators (``,`` vs ``.``) and thousands separators when processing localizable files. By default, **yadg** attempts to infer the locale from the ``LC_NUMERIC`` environment variable; if this is not set in your environment, ``en_GB`` is used as a fallback.


`Dataschema` validation
```````````````````````
Additionally, **yadg** provides `dataschema` validation functionality, by using the schema models from the :mod:`dgbowl_schemas.yadg.dataschema` package, implemented in |Pydantic|_. The schemas are developed in lockstep with **yadg**. This |Pydantic|-based validator class should be used to ensure that the incoming `dataschema` is valid.
Expand Down
1 change: 1 addition & 0 deletions docs/source/version.5_1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Other changes in ``yadg-5.1`` are:

- The dataschema has been simplified, eliminating parsers in favour of extractors.
- The code has been reorganised to highlight the extractor functionality in favour of parsers.
- Locale-aware functionality now uses :mod:`babel` instead of the built-in :mod:`locale` module. This means the ``locale`` argument should now be a :class:`str` containing at least the 2-letter country code, ideally also a territory (e.g. ``en_US`` or ``de_CH``). As of ``yadg-5.1``, no :func:`locale.setlocale` is called, making locale procesing in **yadg** thread-safe.

Bug fixes in ``yadg-5.1`` include:

Expand Down

0 comments on commit 25e3974

Please sign in to comment.