From b86ce5e525f6553f823514316a4d5fc0520969e6 Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Mon, 11 Nov 2024 17:01:29 -0500 Subject: [PATCH 1/3] Documentation update --- doc/source/api/diffpy.utils.parsers.rst | 13 +++---------- doc/source/api/diffpy.utils.rst | 9 +++++++++ doc/source/api/diffpy.utils.scattering_objects.rst | 13 +++++++------ doc/source/api/diffpy.utils.wx.rst | 1 + doc/source/examples/parsersexample.rst | 6 +++--- doc/source/examples/resampleexample.rst | 6 +++--- doc/source/utilities/parsersutility.rst | 6 +++--- 7 files changed, 29 insertions(+), 25 deletions(-) diff --git a/doc/source/api/diffpy.utils.parsers.rst b/doc/source/api/diffpy.utils.parsers.rst index 0709cf3a..bf3d6cc6 100644 --- a/doc/source/api/diffpy.utils.parsers.rst +++ b/doc/source/api/diffpy.utils.parsers.rst @@ -11,10 +11,10 @@ diffpy.utils.parsers package Submodules ---------- -diffpy.utils.parsers.resample module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +diffpy.utils.parsers.serialization module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. automodule:: diffpy.utils.parsers.resample +.. automodule:: diffpy.utils.parsers.serialization :members: :undoc-members: :show-inheritance: @@ -35,10 +35,3 @@ diffpy.utils.parsers.custom_exceptions module :undoc-members: :show-inheritance: -diffpy.utils.parsers.serialization module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.utils.parsers.serialization - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.utils.rst b/doc/source/api/diffpy.utils.rst index cf69f596..bd4cda5b 100644 --- a/doc/source/api/diffpy.utils.rst +++ b/doc/source/api/diffpy.utils.rst @@ -28,3 +28,12 @@ diffpy.utils.tools module :members: :undoc-members: :show-inheritance: + +diffpy.utils.resampler module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.utils.resampler + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.utils.scattering_objects.rst b/doc/source/api/diffpy.utils.scattering_objects.rst index fe511bf5..b7c24bf1 100644 --- a/doc/source/api/diffpy.utils.scattering_objects.rst +++ b/doc/source/api/diffpy.utils.scattering_objects.rst @@ -11,18 +11,19 @@ diffpy.utils.scattering_objects package Submodules ---------- -diffpy.utils.scattering_objects.user_config module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +diffpy.utils.scattering_objects.diffraction_objects module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. automodule:: diffpy.utils.scattering_objects.user_config +.. automodule:: diffpy.utils.scattering_objects.diffraction_objects :members: :undoc-members: :show-inheritance: -diffpy.utils.scattering_objects.diffraction_objects module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +diffpy.utils.scattering_objects.user_config module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. automodule:: diffpy.utils.scattering_objects.diffraction_objects +.. automodule:: diffpy.utils.scattering_objects.user_config :members: :undoc-members: :show-inheritance: + diff --git a/doc/source/api/diffpy.utils.wx.rst b/doc/source/api/diffpy.utils.wx.rst index 76c89035..60f60599 100644 --- a/doc/source/api/diffpy.utils.wx.rst +++ b/doc/source/api/diffpy.utils.wx.rst @@ -18,3 +18,4 @@ diffpy.utils.wx.gridutils module :members: :undoc-members: :show-inheritance: + diff --git a/doc/source/examples/parsersexample.rst b/doc/source/examples/parsersexample.rst index 90605741..b709de60 100644 --- a/doc/source/examples/parsersexample.rst +++ b/doc/source/examples/parsersexample.rst @@ -14,7 +14,7 @@ Using the parsers module, we can load file data into simple and easy-to-work-wit 2) To get the data table, we will use the ``loadData`` function. The default behavior of this function is to find and extract a data table from a file.:: - from diffpy.utils.parsers import loadData + from diffpy.utils.parsers.loaddata import loadData data_table = loadData('') While this will work with most datasets, on our ``data.txt`` file, we got a ``ValueError``. The reason for this is @@ -53,7 +53,7 @@ Using the parsers module, we can load file data into simple and easy-to-work-wit 4) Rather than working with separate ``data_table`` and ``hdata`` objects, it may be easier to combine them into a single dictionary. We can do so using the ``serialize_data`` function. :: - from diffpy.utils.parsers import serialize_data + from diffpy.utils.parsers.loaddata import serialize_data file_data = serialize_data('') 6) Finally, ``serialize_data`` allows us to store data from multiple text file in a single serial file. For one last bit diff --git a/doc/source/examples/resampleexample.rst b/doc/source/examples/resampleexample.rst index efa3c474..f7ba5e18 100644 --- a/doc/source/examples/resampleexample.rst +++ b/doc/source/examples/resampleexample.rst @@ -15,14 +15,14 @@ given enough datapoints. `_. :: - from diffpy.utils.parsers import loadData + from diffpy.utils.parsers.loaddata import loadData nickel_datatable = loadData('') nitarget_datatable = loadData('') Each data table has two columns: first is the grid and second is the function value. To extract the columns, we can utilize the serialize function ... :: - from diffpy.utils.parsers import serialize_data + from diffpy.utils.parsers.serialization import serialize_data nickel_data = serialize_data('Nickel.gr', {}, nickel_datatable, dt_colnames=['grid', 'func']) nickel_grid = nickel_data['Nickel.gr']['grid'] nickel_func = nickel_data['Nickel.gr']['func'] @@ -54,7 +54,7 @@ given enough datapoints. ... and use the diffpy.utils ``wsinterp`` function to resample on this grid.:: - from diffpy.utils.parsers import wsinterp + from diffpy.utils.resampler import wsinterp nickel_resample = wsinterp(grid, nickel_grid, nickel_func) target_resample = wsinterp(grid, target_grid, target_func) diff --git a/doc/source/utilities/parsersutility.rst b/doc/source/utilities/parsersutility.rst index f653c3d7..ffaf768e 100644 --- a/doc/source/utilities/parsersutility.rst +++ b/doc/source/utilities/parsersutility.rst @@ -5,7 +5,7 @@ Parsers Utility The ``diffpy.utils.parsers`` module allows users to easily and robustly load file data into a Python project. -- ``loadData()``: Find and load a data table/block from a text file. This seems to work for most datafiles +- ``loaddata.loadData()``: Find and load a data table/block from a text file. This seems to work for most datafiles including those generated by diffpy programs. Running only ``numpy.loadtxt`` will result in errors for most these files as there is often excess data or parameters stored above the data block. Users can instead choose to load all the parameters of the form `` = `` into a dictionary @@ -14,10 +14,10 @@ The ``diffpy.utils.parsers`` module allows users to easily and robustly load fil The program identifies data blocks as the first matrix block with a constant number of columns. A user can tune the minimum number of rows this matrix block must have. -- ``deserialize_data()``: Load data from a serial file format into a Python dictionary. Currently, the only supported +- ``serialization.deserialize_data()``: Load data from a serial file format into a Python dictionary. Currently, the only supported serial format is ``.json``. -- ``serialize_data()``: Serialize the data generated by ``loadData()`` into a serial file format. Currently, the only +- ``serialization.serialize_data()``: Serialize the data generated by ``loadData()`` into a serial file format. Currently, the only supported serial format is ``.json``. For a more in-depth tutorial for how to use these parser utilities, click :ref:`here `. From dac72cb6a0dad627ccf43e4ecc56e293cc44106d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 22:02:24 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit hooks --- doc/source/api/diffpy.utils.parsers.rst | 1 - doc/source/api/diffpy.utils.rst | 1 - doc/source/api/diffpy.utils.scattering_objects.rst | 1 - doc/source/api/diffpy.utils.wx.rst | 1 - 4 files changed, 4 deletions(-) diff --git a/doc/source/api/diffpy.utils.parsers.rst b/doc/source/api/diffpy.utils.parsers.rst index bf3d6cc6..3456f24e 100644 --- a/doc/source/api/diffpy.utils.parsers.rst +++ b/doc/source/api/diffpy.utils.parsers.rst @@ -34,4 +34,3 @@ diffpy.utils.parsers.custom_exceptions module :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.utils.rst b/doc/source/api/diffpy.utils.rst index bd4cda5b..b873c333 100644 --- a/doc/source/api/diffpy.utils.rst +++ b/doc/source/api/diffpy.utils.rst @@ -36,4 +36,3 @@ diffpy.utils.resampler module :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.utils.scattering_objects.rst b/doc/source/api/diffpy.utils.scattering_objects.rst index b7c24bf1..4607ad98 100644 --- a/doc/source/api/diffpy.utils.scattering_objects.rst +++ b/doc/source/api/diffpy.utils.scattering_objects.rst @@ -26,4 +26,3 @@ diffpy.utils.scattering_objects.user_config module :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.utils.wx.rst b/doc/source/api/diffpy.utils.wx.rst index 60f60599..76c89035 100644 --- a/doc/source/api/diffpy.utils.wx.rst +++ b/doc/source/api/diffpy.utils.wx.rst @@ -18,4 +18,3 @@ diffpy.utils.wx.gridutils module :members: :undoc-members: :show-inheritance: - From 8cd36296793162f311e361681343a26f4f1cc31c Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Mon, 11 Nov 2024 17:03:16 -0500 Subject: [PATCH 3/3] news --- news/doc-update.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/doc-update.rst diff --git a/news/doc-update.rst b/news/doc-update.rst new file mode 100644 index 00000000..1993a616 --- /dev/null +++ b/news/doc-update.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Paths in our documentation reflect changes made in code. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*