Skip to content
Snippets Groups Projects
Commit 0ba805bc authored by Oriol Tintó's avatar Oriol Tintó
Browse files

Update documentation

parent 1973b1ea
Branches docs
No related tags found
No related merge requests found
Pipeline #17002 failed
...@@ -3,21 +3,26 @@ ...@@ -3,21 +3,26 @@
Examples Examples
======== ========
Gallery of examples: Python API
----------
.. toctree:: Compression
:maxdepth: 1 ...........
:caption: Using the Python API
./compress_dataset.ipynb .. literalinclude:: ../../../examples/python_scripts/compress_dataset.py
./analyze_dataset.ipynb :language: python
./analyze_file.ipynb :linenos:
./analyze_and_compress_dataset.ipynb
./compress_dataset_without_enstools_write.ipynb
Analysis
........
.. toctree:: .. literalinclude:: ../../../examples/python_scripts/analyze_file.py
:maxdepth: 1 :language: python
:caption: Using the Command Line Interface :linenos:
./compress_file.ipynb Analysis and Compression
........................
.. literalinclude:: ../../../examples/python_scripts/analyze_and_compress_dataset.py
:language: python
:linenos:
...@@ -7,7 +7,7 @@ User Guide ...@@ -7,7 +7,7 @@ User Guide
.. grid:: 1 .. grid:: 1
.. grid-item-card:: .. grid-item-card::
:columns: 7 :columns: 5
.. image:: ../images/icons/api.svg .. image:: ../images/icons/api.svg
:width: 50% :width: 50%
...@@ -22,7 +22,7 @@ User Guide ...@@ -22,7 +22,7 @@ User Guide
Using the **Python API** Using the **Python API**
.. grid-item-card:: .. grid-item-card::
:columns: 7 :columns: 5
.. image:: ../images/icons/cli.svg .. image:: ../images/icons/cli.svg
:width: 50% :width: 50%
......
...@@ -31,7 +31,7 @@ To analyze a dataset: ...@@ -31,7 +31,7 @@ To analyze a dataset:
.. code:: .. code::
from enstools.io import read from enstools.io import read
from enstools.encoding.api import analyze_dataset from enstools.compression.api import analyze_dataset
with read("input.nc") as dataset: with read("input.nc") as dataset:
results = analyze_dataset(dataset) results = analyze_dataset(dataset)
...@@ -40,9 +40,34 @@ To analyze a file: ...@@ -40,9 +40,34 @@ To analyze a file:
.. code:: .. code::
from enstools.encoding.api import analyze_files from enstools.compression.api import analyze_files
results = analyze_files("input.nc") results = analyze_files("input.nc")
Emulator
........
.. code::
from enstools.io import read
from enstools.encoding.api import emulate_compression_on_dataset
results = analyze_files("input.nc")
with read("input.nc") as dataset:
compressed_dataset = emulate_compression_on_dataset(dataset, compression="lossy,sz,pw_rel,1e-5", inplace=False)
diff = compressed_dataset - dataset
xarray accessor
...............
.. code::
from enstools.io import read
import enstools.compression.xr_accessor
with read("input.nc") as dataset:
results = dataset.compression.analyze()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment