Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FAQs page to docs #181

Merged
merged 4 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
22 changes: 22 additions & 0 deletions docs/faqs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
==========================
Frequently Asked Questions
==========================

How do I open files that have conflicting values for a data variable(s)?
------------------------------------------------------------------------
In xarray, the default setting for checking compatibility across files is ``compat='no_conflicts'``.
If conflicting values exist for a data variable between the files, xarray raises ``MergeError: conflicting values for variable <DATA VAR NAME> on objects to be combined. You can skip this check by specifying compat="override".``
tomvothecoder marked this conversation as resolved.
Show resolved Hide resolved

Let's say you try opening two files using ``xcdat.open_mfdataset()`` and the aforementioned ``MergeError`` appears for the ``lat_bnds`` data var.
You perform a floating point comparison between both files for ``lat_bnds`` and find a very small floating point difference at specific coordinates.

To workaround this data quality issue and proceed with opening the files, pass these keyword arguments:

1. ``compat="override"``: skip comparing and pick variable from first dataset
2. ``join="override"``: if indexes are of same size, rewrite indexes to be those of the first object with that dimension. Indexes for the same dimension must have the same size in all objects.

- ``join`` is set to `"outer_join"` by default, which might not be desired.

``xcdat.open_mfdataset('path/to/files/*.nc', compat="override", join="override")``

More information here: https://xarray.pydata.org/en/stable/generated/xarray.open_mfdataset.html#xarray-open-mfdataset
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ See `LICENSE <LICENSE>`_ for details
Getting Started <getting_started>
API Reference <api>
Xarray API Reference <https://xarray.pydata.org/en/stable/api.html>
Frequently Asked Questions <faqs>

.. toctree::
:maxdepth: 2
Expand Down