Skip to content

Commit 59f003d

Browse files
authored
Merge pull request #244 from khaeru/enh/to_pandas-labels
Refine handling of labels="both"
2 parents 07683cc + 1eca925 commit 59f003d

File tree

20 files changed

+323
-216
lines changed

20 files changed

+323
-216
lines changed

doc/api/format.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In general, the :mod:`sdmx` package:
1616

1717
- **reads** most :ref:`sdmx-csv`, :ref:`sdmx-json` 1.0, and :ref:`sdmx-ml` messages;
1818
see details in the individual sections below and the linked :mod:`.reader` submodules.
19-
- **writes** certain :ref:`sdmx-csv` 1.0, and :ref:`sdmx-ml` formats;
19+
- **writes** certain :ref:`sdmx-csv` and :ref:`sdmx-ml` formats;
2020
see details below and the linked :ref:`.writer` submodules.
2121
- is **tested** using collected specimens of messages in various formats,
2222
stored in the `khaeru/sdmx-test-data <https://github.com/khaeru/sdmx-test-data/>`_ Git repository.
@@ -62,15 +62,19 @@ The SDMX-CSV *format* is versioned differently from the overall SDMX *standard*:
6262
The format differs from and is not backwards compatible with SDMX-CSV 1.0.
6363
SDMX-CSV 2.0.0 files are recognizable by the header ``STRUCTURE`` in the first column of the first row.
6464

65+
:mod:`.reader.csv` supports reading SDMX-CSV 2.0.0.
66+
6567
.. versionadded:: 2.19.0
6668

67-
Initial support for *reading* SDMX-CSV 2.0.0.
68-
See :mod:`.reader.csv`.
69+
Initial support for reading SDMX-CSV 2.0.0.
70+
71+
:mod:`.writer.csv` supports writing SDMX-CSV 2.0.0.
72+
Currently, only :attr:`Keys.none` is supported;
73+
passing any other value raises :class:`ValueError`.
6974

7075
.. versionadded:: 2.23.0
7176

72-
Initial support for *writing* SDMX-CSV 2.0.0.
73-
See :mod:`.writer.csv`.
77+
Initial support for writing SDMX-CSV 2.0.0.
7478

7579
.. automodule:: sdmx.format.csv.common
7680
:members:

doc/walkthrough.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ We also see that 'USD' and 'JPY' are valid values along both dimensions.
274274

275275
Attribute names and allowed values can be obtained in a similar fashion.
276276

277-
278277
Select and query data from a dataflow
279278
=====================================
280279

@@ -430,12 +429,16 @@ Thus we can now generate our pandas DataFrame from daily exchange rate data only
430429
cur_df.shape
431430
cur_df.tail()
432431
433-
434432
.. _datetime:
435433

436434
Convert dimensions to :class:`pandas.DatetimeIndex` or :class:`~pandas.PeriodIndex`
437435
-----------------------------------------------------------------------------------
438436

437+
.. warning:: This section describes the use of the deprecated :attr:`~.PandasConverter.datetime` argument.
438+
See the migration notes for :ref:`v2.23.0`.
439+
440+
.. todo:: Update the section to use the current arguments.
441+
439442
SDMX datasets often have a :class:`~.Dimension` with a name like ``TIME_PERIOD``.
440443
To ease further processing of time-series data read from SDMX messages,
441444
:func:`.convert_dataset` provides a `datetime` argument

doc/whatsnew.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ All changes
4040
- :func:`sdmx.util.compare` is deprecated and will be removed in a future version.
4141

4242
- :func:`.to_csv` supports writing :ref:`sdmx-csv` version 2.0.0 (:pull:`243`).
43-
- :func:`.to_csv` and :func:`.to_pandas` support :attr:`.Labels.both`
44-
(:pull:`243`, thanks :gh-user:`aboddie` for :pull:`242`).
45-
- New modules (:pull:`243`):
43+
- :func:`.to_csv` and :func:`.to_pandas` support :attr:`.Labels.both` and :attr:`.Labels.name`
44+
(:pull:`243`, :pull:`244`, thanks :gh-user:`aboddie` for :pull:`242`).
45+
- New modules (:pull:`243`, :pull:`244`):
4646

4747
- :mod:`.convert` and :mod:`.convert.common`.
4848
- :mod:`.convert.pandas` and :class:`.PandasConverter`, replacing :py:`.writer.pandas`.
@@ -56,6 +56,10 @@ All changes
5656
- Key is sortable (:pull:`234`).
5757
- :meth:`.Key.copy` returns the same type for subclasses (:pull:`243`).
5858

59+
- :meth:`DataStructure.make_key <.BaseDataStructureDefinition.make_key>`
60+
associates :class:`.Code` to :attr:`.KeyValue.value`
61+
when :attr:`.Representation.enumerated` is set
62+
for the respective :attr:`Dimension.local_representation <.Component.local_representation>` (:pull:`244`).
5963
- :func:`.install_schemas` and :func:`.construct_schema` fetch, store, and use a local copy of :file:`xhtml1-strict.dsd` (:pull:`236`, :issue:`235`).
6064
This enables use of :func:`.validate_xml`
6165
with lxml version 6.0.0 (`released 2025-06-26 <https://lxml.de/6.0/changes-6.0.0.html>`__)

0 commit comments

Comments
 (0)