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

make sphinx run again #167

Merged
merged 19 commits into from
Nov 17, 2022
Merged
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
9 changes: 5 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,11 @@
# Should only be uncommented when testing page development while notebooks
# are breaking.
# nbsphinx_kernel_name = "bitinfo-docs" # doesnt work
nbsphinx_allow_errors = False
nbsphinx_timeout = 600
nbsphinx_execute = "never" # "auto" "always"
jupyter_execute_notebooks = "off"
nb_execution_timeout = 120
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking into the raw log of the docs build, I found a CellTimeoutError. Fixing with https://myst-nb.readthedocs.io/en/latest/configuration.html

nb_execution_mode = "auto"
nb_execution_allow_errors = False
nb_execution_raise_on_error = True
nb_execution_show_tb = True

# Napoleon configurations
napoleon_google_docstring = False
Expand Down
20 changes: 15 additions & 5 deletions docs/quick-start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
"source": [
"import xbitinfo as xb\n",
"\n",
"import xarray as xr\n",
"\n",
"xr.set_options(display_style=\"text\")"
"import xarray as xr"
]
},
{
Expand All @@ -29,9 +27,9 @@
"metadata": {},
"outputs": [],
"source": [
"ds = xr.tutorial.load_dataset(\"eraint_uvz\")\n",
"ds = xr.tutorial.load_dataset(\"eraint_uvz\").astype(\"float32\")\n",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you approve of this fix in the quickstart or better take another sample dataset?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is okay for now. Could you mention this specific commit in issue #168 so that we do not forget to revert it.
Other datasets in the tutorial are often also offset/scale compressed leading to float64. The best alternative might be "ROMS_example", but since the coordinates are quite complex it might cause some new issues.

"\n",
"# xb.plot_distribution(ds)",
"xb.plot_distribution(ds)",
"\n",
"ds"
]
Expand Down Expand Up @@ -119,6 +117,18 @@
"ds_bitrounded = xb.xr_bitround(ds, keepbits)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8af292c1-1354-45a9-ba04-e129acfad3ba",
"metadata": {},
"outputs": [],
"source": [
"xr.concat([ds, ds_bitrounded], \"bitround\").isel(level=0)[\"v\"].plot(\n",
" col=\"bitround\", row=\"month\"\n",
")"
]
},
{
"cell_type": "markdown",
"id": "c0b507c7-4261-4ff0-8d8e-617d874c6832",
Expand Down
4 changes: 4 additions & 0 deletions xbitinfo/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ def plot_bitinformation(bitinfo, cmap="turku"):
1,
), "Only bitinfo along one dimension is supported at the moment. Please select dimension before plotting."

assert (
"bit32" in bitinfo.dims
), "currently only works properly for float32 data, looking forward to your PR closing https://github.com/observingClouds/xbitinfo/issues/168"

nvars = len(bitinfo)
varnames = bitinfo.keys()

Expand Down