Skip to content

Commit

Permalink
Initial code base
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrivenaes committed Mar 9, 2021
1 parent 07a4cc0 commit 0a05de4
Show file tree
Hide file tree
Showing 23 changed files with 1,012 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# vscode
.vscode/
112 changes: 112 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#!/usr/bin/env python3

# noqa # pylint: skip-file

from datetime import date
import fmu.dataio

# -- General configuration ---------------------------------------------

# The full version, including alpha/beta/rc tags.
release = fmu.dataio.__version__

extensions = [
"sphinxcontrib.apidoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.mathjax",
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
]

apidoc_module_dir = "../src/fmu/dataio"
apidoc_output_dir = "apiref"
apidoc_excluded_paths = ["tests"]
apidoc_separate_modules = True
apidoc_module_first = True
apidoc_extra_args = ["-H", "API reference for fmu.dataio"]

autoclass_content = "both"

napoleon_include_special_with_doc = False

# The suffix of source filenames.
source_suffix = {".rst": "restructuredtext", ".md": "markdown"}

# The master toctree document.
master_doc = "index"

# General information about the project.
project = "fmu.dataio"
current_year = date.today().year
copyright = "Equinor 2019 - " + str(current_year) + f" (XTGeo release {release})"


# Sort members by input order in classes
autodoc_member_order = "bysource"
autodoc_default_flags = ["members", "show_inheritance"]

exclude_patterns = ["_build"]

pygments_style = "sphinx"

html_theme = "sphinx_rtd_theme"

html_theme_options = {
"style_nav_header_background": "#C0C0C0",
}


# html_logo = "images/xtgeo-logo.png"

# The name of an image file (within the static path) to use as favicon
# of the docs. This file should be a Windows icon file (.ico) being
# 16x16 or 32x32 pixels large.
# html_favicon = None


# If not '', a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names
# to template names.
# html_additional_pages = {}

# If false, no module index is generated.
# html_domain_indices = True

# If false, no index is generated.
# html_use_index = True

# If true, the index is split into individual pages for each letter.
# html_split_index = False

# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer.
# Default is True.
# html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer.
# Default is True.
# html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages
# will contain a <link> tag referring to it. The value of this option
# must be the base URL from which the finished HTML is served.
# html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = "dataio"
99 changes: 99 additions & 0 deletions docs/example_surface.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# example YAML for surfaces

# data:
# The data block describes the actual data (e.g. surface) independent of FMU.
# Some fields are required, while some are optional. This is defined in the
# schema json file.

data:
class: regularsurface
$schema: https://main-fmu-schemas-dev.radix.equinor.com/schemas/0.6.0/fmu_surface.json
format: irap_binary
content: depth
stratigraphic: true
source: rms/structural_model
relative_path: share/results/maps/volantis_gp_base--depth.gri
checksum: a6ee5096e69ff220aaac25fe86de8206
description:
- Depth surfaces extracted from the structural model
- Made in a FMU work flow
spec:
units: metric
ncol: 281
nrow: 441
xori: 461499.9997558594
yori: 5926500.0
xinc: 25.0
yinc: 25.0
yflip: 1
rotation: 30.000000834826057
undef: 1.0e+33
xmin: 456012.5003497944
xmax: 467540.52762886323
ymin: 5926499.999511719
ymax: 5939492.128326312
zmin: 1244.039
zmax: 2302.683
time1: null
time2: null

# the visuals are optional and taken from e.g. fmuconfig
visuals:
name: Top Volantis
color: black
colortable: gist_rainbow
contours: true
fill: true
range:
- 1627
- 1958

ssdl:
access_level: internal
rep_include: true

# masterdata:
# These are static data read from external config YAML file (fmuconfig or similar).
# Some of these static data are used while processing to populate some non-required
# fields in data block (for example names alias, color-tables)

masterdata:
smda:
$schema: some_schema.json
description:
- Tutorials & stuff
- Some other comment
country:
- identifier: Norway
uuid: ad214d85-8a1d-19da-e053-c918a4889309
discovery:
- short_identifier: null
uuid: null
field:
- identifier: DROGON
uuid: 00000000-0000-0000-0000-000000000000
coordinates:
system_identifier: ST_WGS84_UTM37N_P32637
system_uuid: ad214d85-dac7-19da-e053-c918a4889309
stratigraphy:
smda_identifier: DROGON_2020
smda_uuid: some-unique-id-to-be-provided-by-smda

# fmu
# The FMU block is required when data are produced in a FMU work flow,
# and it consists of to major sub-parts:
# - template .. model setup
# - ensemble .. ensemble setup and metadata

fmu:
template:
name: Drogon
structure: ff
revision: 21.0.0.dev
description:
- detailed description
- optional

ensemble:
$schema: some_schema.json
status: null
25 changes: 25 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Examples
========

Exporting surfaces in RMS Python
--------------------------------

.. code-block:: python
from fmu.config import utilities as ut
from fmu.dataio import ExportFromRMS
CFG = ut.yaml_load("../../fmuconfig/output/global_variables.yml")
META_DEPTH = CFG["global"]["something"]
EXP = ExportFromRMS(project)
NAMES = ["TopValysar", "TopVolon"]
def export_horizons():
EXP.to_file(names=NAMES, category="DS_interp", metadata=META)
if __name__ == "__main__":
export_horizons()
16 changes: 16 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Welcome to fmu-dataio' documentation!
======================================

Contents:

.. toctree::
:maxdepth: 2

apiref/modules

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# NOTE: you have to use single-quoted strings in TOML for regular expressions.
[tool.black]
line-length = 88
target-version = ['py36', 'py37', 'py38']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
# The following are specific to Black, you probably don't want those.
| blib2to3
| tests/data
| profiling
)/
'''

[build-system]
requires = ["pip>=19.1.1", "setuptools>=28", "setuptools_scm>=3.2.0", "wheel"]
2 changes: 2 additions & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
xtgeo>2.13
ruamel-yaml
5 changes: 5 additions & 0 deletions requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sphinx
sphinx_rdt_theme
autoapi
sphinx-autodoc-typehints
sphinxcontrib-apidoc
3 changes: 3 additions & 0 deletions requirements/requirements_setup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setuptools>=28
setuptools_scm
pytest-runner
1 change: 1 addition & 0 deletions requirements/requirements_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest
6 changes: 6 additions & 0 deletions requirements/requirements_testx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Extras for tests, formatting and linting
black>=20.8b0
flake8
pytest-cov
pytest-mock
rstcheck
3 changes: 3 additions & 0 deletions scripts/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Helper functions and extra requirements for setup.py.

The purpose is to keep setup.py lean and clean
Loading

0 comments on commit 0a05de4

Please sign in to comment.