diff --git a/docs/source/examples/diffraction_objects_example.rst b/docs/source/examples/diffraction_objects_example.rst index 1122bf2..8794c71 100644 --- a/docs/source/examples/diffraction_objects_example.rst +++ b/docs/source/examples/diffraction_objects_example.rst @@ -180,7 +180,7 @@ For example, attempting to add a diffraction object and a string will raise an e .. code-block:: python - tth_ninety_index = diff_object1.get_array_index(90, xtype="tth") + tth_ninety_index = diff_object1.get_array_index(xvalue=90, xtype="tth") intensity_at_ninety = diff_object1.on_tth()[1][tth_ninety_index] If you do not specify an ``xtype``, it will default to the ``xtype`` used when creating the ``DiffractionObject``. @@ -190,8 +190,8 @@ you can find its closest index for ``q=0.25`` by typing either of the following: .. code-block:: python print(do._input_xtype) # remind ourselves which array was input. prints "q" in this case. - index = do.get_array_index(0.25) # no xtype passed, defaults to do._input_xtype, or in this example, q - index = do.get_array_index(0.25, xtype="q") # explicitly choose an xtype to specify a value + index = do.get_array_index(xvalue=0.25) # no xtype passed, defaults to do._input_xtype, or in this example, q + index = do.get_array_index(xvalue=0.25, xtype="q") # explicitly choose an xtype to specify a value 5. The ``dump`` function saves the diffraction data and relevant information to an xy format file with headers (widely used chi format used, for example, by Fit2D and diffpy. These files can be read by ``LoadData()`` diff --git a/docs/source/examples/parsers_example.rst b/docs/source/examples/parsers_example.rst index 92135f3..09220a3 100644 --- a/docs/source/examples/parsers_example.rst +++ b/docs/source/examples/parsers_example.rst @@ -104,8 +104,7 @@ Now we can extract specific data table columns from the dictionary. parsed_file_data = serialize_data('', hdata, data_table, serial_file='') - The returned value, ``parsed_file_data``, is the dictionary we just added to ``serialfile.json``. - To extract the data from the serial file, we use ``deserialize_data``. +The returned value, ``parsed_file_data``, is the dictionary we just added to ``serialfile.json``. To extract the data from the serial file, we use ``deserialize_data``. .. code-block:: python diff --git a/docs/source/examples/resample_example.rst b/docs/source/examples/resample_example.rst index 4884f5c..ba28390 100644 --- a/docs/source/examples/resample_example.rst +++ b/docs/source/examples/resample_example.rst @@ -23,18 +23,6 @@ given enough datapoints. 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 ... -.. code-block:: python - - 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'] - target_data = serialize_data('NiTarget.gr', {}, nitarget_datatable, dt_colnames=['grid', 'function']) - target_grid = nickel_data['Nickel.gr']['grid'] - target_func = nickel_data['Nickel.gr']['func'] - -To extract the columns, we can utilize the serialize function ... - .. code-block:: python from diffpy.utils.parsers.serialization import serialize_data diff --git a/news/fix-docs-example.rst b/news/fix-docs-example.rst new file mode 100644 index 0000000..0048f8a --- /dev/null +++ b/news/fix-docs-example.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news added: Fix some examples in the documentation. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*