.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/03_visualise_blockmodel.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_03_visualise_blockmodel.py: Block Models ============ Block models represent 3D data, typically via a 3D array. 3D arrays can be flattened into a 2D tabular representation that can be stored in a parquet file. .. GENERATED FROM PYTHON SOURCE LINES 9-16 .. code-block:: default import tempfile import pandas as pd from pathlib import Path from parq_blockmodel import ParquetBlockModel .. GENERATED FROM PYTHON SOURCE LINES 17-20 Create a Parquet Block Model ---------------------------- We leverage the create_demo_block_model class method to create a Parquet Block Model. .. GENERATED FROM PYTHON SOURCE LINES 20-28 .. code-block:: default temp_dir = Path(tempfile.gettempdir()) / "block_model_example" temp_dir.mkdir(parents=True, exist_ok=True) pbm: ParquetBlockModel = ParquetBlockModel.create_demo_block_model( filename=temp_dir / "demo_block_model.parquet") pbm .. rst-class:: sphx-glr-script-out .. code-block:: none ParquetBlockModel(name=demo_block_model, path=/tmp/block_model_example/demo_block_model.pbm.parquet) .. GENERATED FROM PYTHON SOURCE LINES 29-32 Create Report ------------- We'll create a report for the Parquet Block Model. .. GENERATED FROM PYTHON SOURCE LINES 32-35 .. code-block:: default pbm.create_report(open_in_browser=True, show_progress=True) .. rst-class:: sphx-glr-script-out .. code-block:: none Profiling columns: 0%| | 0/7 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 03_visualise_blockmodel.ipynb <03_visualise_blockmodel.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_