Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ API documentation
api/datastructureconfig
api/codelist
api/regionprocessor
api/datavalidator
api/requireddatavalidator
api/countries
api/nuts
api/testing
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

.. currentmodule:: nomenclature

Data validation
===============
**DataValidator**
=================

**Data validation** checks if timeseries data values are within specified ranges.

Expand Down Expand Up @@ -67,12 +67,13 @@ tolerance of 1 to the value of 2, with warning level ``error`` by default.
Standard usage
--------------

Run the following in a Python script to check that an IAMC dataset has valid data.

.. code-block:: python

from nomenclature.processor import DataValidator

# ...setting directory/file paths and loading dataset

DataValidator.from_file(data_val_yaml).apply(df)

.. autoclass:: DataValidator
:members: from_file, from_codelist, apply
2 changes: 1 addition & 1 deletion docs/api/regionprocessor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
===================

.. autoclass:: RegionProcessor
:members: from_directory, validate_with_definition, apply, check_region_aggregation
:members: from_directory, apply, check_region_aggregation, revert
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

.. currentmodule:: nomenclature

Required data validation
========================
**RequiredDataValidator**
=========================

**Required data validation** checks if certain models, variables, regions and/or
**Required data validation** checks if certain models, variables, regions and/or
periods of time are covered in the timeseries data.

For this, a configuration file specifies the model(s) and dimension(s) expected
Expand All @@ -31,13 +31,14 @@ years 2020, 2030, 2040 and 2050.
Standard usage
--------------

Run the following in a Python script to check that an IAMC dataset has valid
required data.

.. code-block:: python

from nomenclature import RequiredDataValidator

# ...setting directory/file paths and loading dataset

RequiredDataValidator.from_file(req_data_yaml).apply(df)


.. autoclass:: RequiredDataValidator
:members: from_file, apply, check_required_data_per_model, validate_with_definition
17 changes: 0 additions & 17 deletions docs/user_guide/validation.rst

This file was deleted.

6 changes: 3 additions & 3 deletions nomenclature/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def run_workflow(
input_file : Path
Input data file, must be IAMC format, .xlsx or .csv
workflow_file : Path
Path to the workflow file,
default: current working directory / "workflow.py"
Path to the workflow file,
default: current working directory / "workflow.py"
workflow_function : str
Name of the workflow function inside the workflow file, default: main
output_file : Path | None
Expand All @@ -252,7 +252,7 @@ def run_workflow(
if not hasattr(workflow, workflow_function):
raise ValueError(f"{workflow} does not have a function `{workflow_function}`")

df = getattr(workflow, workflow_function)(IamDataFrame(input_file))
df: IamDataFrame = getattr(workflow, workflow_function)(IamDataFrame(input_file))
if output_file is not None:
df.to_excel(output_file)

Expand Down
Loading