Skip to content

Commit 276f564

Browse files
committed
dev
1 parent 1aa6a06 commit 276f564

File tree

10 files changed

+28
-27
lines changed

10 files changed

+28
-27
lines changed

cf/read_write/um/umread.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,7 +3566,7 @@ def read(
35663566
# Return now if there are valid file types
35673567
return []
35683568

3569-
f = self.file_open(filename, parse=True)
3569+
f = self.dataset_open(filename, parse=True)
35703570

35713571
info = is_log_level_info(logger)
35723572

@@ -3589,7 +3589,7 @@ def read(
35893589
for var in f.vars
35903590
]
35913591

3592-
self.file_close()
3592+
self.dataset_close()
35933593

35943594
return [field for x in um for field in x.fields if field]
35953595

@@ -3623,7 +3623,7 @@ def _open_um_file(
36233623
The open PP or FF file object.
36243624
36253625
"""
3626-
self.file_close()
3626+
self.dataset_close()
36273627
try:
36283628
f = File(
36293629
filename,
@@ -3669,15 +3669,15 @@ def is_um_file(self, filename):
36693669
try:
36703670
# Note: No need to completely parse the file to ascertain
36713671
# if it's PP or FF.
3672-
self.file_open(filename, parse=False)
3672+
self.dataset_open(filename, parse=False)
36733673
except Exception:
3674-
self.file_close()
3674+
self.dataset_close()
36753675
return False
36763676
else:
3677-
self.file_close()
3677+
self.dataset_close()
36783678
return True
36793679

3680-
def file_close(self):
3680+
def dataset_close(self):
36813681
"""Close the file that has been read.
36823682
36833683
:Returns:
@@ -3691,7 +3691,7 @@ def file_close(self):
36913691

36923692
self._um_file = None
36933693

3694-
def file_open(self, filename, parse=True):
3694+
def dataset_open(self, filename, parse=True):
36953695
"""Open the file for reading.
36963696
36973697
:Paramters:

docs/source/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def _get_date():
389389
"run_stale_examples": False,
390390
# Below setting can be buggy: see:
391391
# https://github.com/sphinx-gallery/sphinx-gallery/issues/967
392-
#"reference_url": {"cf": None},
392+
# "reference_url": {"cf": None},
393393
"backreferences_dir": "gen_modules/backreferences",
394394
"doc_module": ("cf",),
395395
"inspect_global_variables": True,
@@ -476,7 +476,6 @@ def _get_date():
476476
import cf
477477

478478

479-
480479
def linkcode_resolve(domain, info):
481480
# =================================================================
482481
# Must delete all .doctrees directories in build for changes to be

docs/source/recipes/plot_08_recipe.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
# 1. Import cf-python, cf-plot, numpy and scipy.stats:
1010

1111
import cfplot as cfp
12-
import cf
13-
1412
import numpy as np
1513
import scipy.stats as stats
1614

15+
import cf
1716

1817
# %%
1918
# 2. Three functions are defined:

docs/source/recipes/plot_12_recipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# %%
1414
# 1. Import cf-python, cf-plot and matplotlib.pyplot:
1515

16-
import matplotlib.pyplot as plt
1716
import cfplot as cfp
17+
import matplotlib.pyplot as plt
1818

1919
import cf
2020

docs/source/recipes/plot_13_recipe.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@
1818
# in next steps.
1919

2020
import cartopy.crs as ccrs
21-
import matplotlib.patches as mpatches
22-
2321
import cfplot as cfp
22+
import matplotlib.patches as mpatches
2423

2524
import cf
2625

27-
2826
# %%
2927
# 2. Read and select the SST by index and look at its contents:
3028
sst = cf.read("~/recipes/ERA5_monthly_averaged_SST.nc")[0]

docs/source/recipes/plot_17_recipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# %%
1212
# 1. Import cf-python and cf-plot:
1313

14-
import matplotlib.pyplot as plt
1514
import cfplot as cfp
15+
import matplotlib.pyplot as plt
1616

1717
import cf
1818

docs/source/recipes/plot_18_recipe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
1111
"""
1212

13+
import cfplot as cfp
14+
1315
# %%
1416
# 1. Import cf-python, cf-plot and other required packages:
1517
import matplotlib.pyplot as plt
1618
import scipy.stats.mstats as mstats
17-
import cfplot as cfp
1819

1920
import cf
2021

21-
2222
# %%
2323
# 2. Read the data in and unpack the Fields from FieldLists using indexing.
2424
# In our example We are investigating the influence of the land height on

docs/source/recipes/plot_19_recipe.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
maxima.
1010
"""
1111

12+
import cfplot as cfp
13+
1214
# %%
1315
# 1. Import cf-python, cf-plot and other required packages:
1416
import matplotlib.pyplot as plt
15-
import cfplot as cfp
1617

1718
import cf
1819

@@ -55,7 +56,10 @@
5556
# of the maxima, we loop through the season query mapping and do a
5657
# "T: mean" collapse setting the season as the grouping:
5758
cfp.gopen(
58-
rows=2, columns=1, bottom=0.1, top=0.85,
59+
rows=2,
60+
columns=1,
61+
bottom=0.1,
62+
top=0.85,
5963
)
6064
cfp.gpos(1)
6165
cfp.gset(xmin="1980-01-01", xmax="2022-12-01", ymin=304, ymax=312)

docs/source/recipes/plot_22_recipe.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
# %%
1212
# 1. Import cf-python, Dask.array, NumPy, and Matplotlib:
1313

14-
import cf
1514
import dask.array as da
16-
import numpy as np
1715
import matplotlib.pyplot as plt
16+
import numpy as np
17+
18+
import cf
1819

1920
# %%
2021
# 2. Read the field constructs and load the wind speed component fields:

docs/source/recipes/plot_23_recipe.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
# sphinx_gallery_thumbnail_number = 2
1919
# sphinx_gallery_end_ignore
2020

21-
import matplotlib.pyplot as plt
2221
import cfplot as cfp
23-
import cf
24-
25-
import numpy as np
2622
import dask.array as da
23+
import matplotlib.pyplot as plt
24+
import numpy as np
25+
26+
import cf
2727

2828
# %%
2929
# 2. Read example data field constructs, and set region for our plots:

0 commit comments

Comments
 (0)