Skip to content

Commit 51d82a3

Browse files
authored
Merge pull request #854 from davidhassell/add-docs
Add missing docs
2 parents f2e0d41 + a9ada6c commit 51d82a3

24 files changed

+1850
-241
lines changed

cf/domain.py

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from math import prod
2-
from os import sep
32

43
import cfdm
54
import numpy as np
@@ -14,7 +13,6 @@
1413
from .functions import (
1514
_DEPRECATION_ERROR_ARG,
1615
_DEPRECATION_ERROR_METHOD,
17-
abspath,
1816
indices_shape,
1917
parse_indices,
2018
)
@@ -125,43 +123,6 @@ def size(self):
125123
[domain_axis.get_size(0) for domain_axis in domain_axes.values()]
126124
)
127125

128-
def add_file_location(
129-
self,
130-
location,
131-
):
132-
"""Add a new file location in-place.
133-
134-
All data definitions that reference files are additionally
135-
referenced from the given location.
136-
137-
.. versionadded:: 3.15.0
138-
139-
.. seealso:: `del_file_location`, `file_locations`
140-
141-
:Parameters:
142-
143-
location: `str`
144-
The new location.
145-
146-
:Returns:
147-
148-
`str`
149-
The new location as an absolute path with no trailing
150-
path name component separator.
151-
152-
**Examples**
153-
154-
>>> f.add_file_location('/data/model/')
155-
'/data/model'
156-
157-
"""
158-
location = abspath(location).rstrip(sep)
159-
160-
for c in self.constructs.filter_by_data(todict=True).values():
161-
c.add_file_location(location)
162-
163-
return location
164-
165126
def close(self):
166127
"""Close all files referenced by the domain construct.
167128
@@ -188,43 +149,6 @@ def close(self):
188149
removed_at="5.0.0",
189150
) # pragma: no cover
190151

191-
def del_file_location(
192-
self,
193-
location,
194-
):
195-
"""Remove a file location in-place.
196-
197-
All data definitions that reference files will have references
198-
to files in the given location removed from them.
199-
200-
.. versionadded:: 3.15.0
201-
202-
.. seealso:: `add_file_location`, `file_locations`
203-
204-
:Parameters:
205-
206-
location: `str`
207-
The file location to remove.
208-
209-
:Returns:
210-
211-
`str`
212-
The removed location as an absolute path with no
213-
trailing path name component separator.
214-
215-
**Examples**
216-
217-
>>> d.del_file_location('/data/model/')
218-
'/data/model'
219-
220-
"""
221-
location = abspath(location).rstrip(sep)
222-
223-
for c in self.constructs.filter_by_data(todict=True).values():
224-
c.del_file_location(location)
225-
226-
return location
227-
228152
@classmethod
229153
def create_regular(cls, x_args, y_args, bounds=True):
230154
"""
@@ -333,38 +257,6 @@ def create_regular(cls, x_args, y_args, bounds=True):
333257

334258
return domain
335259

336-
def file_locations(
337-
self,
338-
):
339-
"""The locations of files containing parts of the components data.
340-
341-
Returns the locations of any files that may be required to
342-
deliver the computed data arrays of any of the component
343-
constructs (such as dimension coordinate constructs, cell
344-
measure constructs, etc.).
345-
346-
.. versionadded:: 3.15.0
347-
348-
.. seealso:: `add_file_location`, `del_file_location`
349-
350-
:Returns:
351-
352-
`set`
353-
The unique file locations as absolute paths with no
354-
trailing path name component separator.
355-
356-
**Examples**
357-
358-
>>> d.file_locations()
359-
{'/home/data1', 'file:///data2'}
360-
361-
"""
362-
out = set()
363-
for c in self.constructs.filter_by_data(todict=True).values():
364-
out.update(c.file_locations())
365-
366-
return out
367-
368260
@_inplace_enabled(default=False)
369261
def flip(self, axes=None, inplace=False):
370262
"""Flip (reverse the direction of) domain axes.

docs/source/class.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ Field list class
2424

2525
cf.FieldList
2626

27+
Domain class
28+
------------
29+
30+
.. autosummary::
31+
:nosignatures:
32+
:toctree: class/
33+
34+
cf.Domain
35+
2736
Metadata component classes
2837
--------------------------
2938

@@ -32,12 +41,14 @@ Metadata component classes
3241
:toctree: class/
3342

3443
cf.AuxiliaryCoordinate
44+
cf.CellConnectivity
3545
cf.CellMeasure
3646
cf.CellMethod
3747
cf.CoordinateReference
3848
cf.DimensionCoordinate
3949
cf.DomainAncillary
4050
cf.DomainAxis
51+
cf.DomainTopology
4152
cf.FieldAncillary
4253

4354
Constructs class
@@ -60,15 +71,6 @@ Coordinate component classes
6071
cf.CoordinateConversion
6172
cf.Datum
6273

63-
Domain class
64-
------------
65-
66-
.. autosummary::
67-
:nosignatures:
68-
:toctree: class/
69-
70-
cf.Domain
71-
7274
Data classes
7375
------------
7476

docs/source/class/cf.AuxiliaryCoordinate.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,8 @@ Groups
520520
~cf.AuxiliaryCoordinate.nc_set_variable_groups
521521
~cf.AuxiliaryCoordinate.nc_clear_variable_groups
522522

523-
CFA
524-
---
523+
Aggregation
524+
-----------
525525

526526
.. rubric:: Methods
527527

@@ -530,13 +530,8 @@ CFA
530530
:toctree: ../method/
531531
:template: method.rst
532532

533-
~cf.AuxiliaryCoordinate.add_file_location
534-
~cf.AuxiliaryCoordinate.cfa_clear_file_substitutions
535-
~cf.AuxiliaryCoordinate.cfa_del_file_substitution
536-
~cf.AuxiliaryCoordinate.cfa_file_substitutions
537-
~cf.AuxiliaryCoordinate.cfa_update_file_substitutions
538-
~cf.AuxiliaryCoordinate.del_file_location
539-
~cf.AuxiliaryCoordinate.file_locations
533+
~cf.AuxiliaryCoordinate.file_directories
534+
~cf.AuxiliaryCoordinate.replace_directory
540535

541536
Aliases
542537
-------
@@ -721,11 +716,18 @@ Deprecated
721716
:toctree: ../method/
722717
:template: method.rst
723718

719+
~cf.AuxiliaryCoordinate.add_file_location
724720
~cf.AuxiliaryCoordinate.asdatetime
725721
~cf.AuxiliaryCoordinate.asreftime
722+
~cf.AuxiliaryCoordinate.cfa_clear_file_substitutions
723+
~cf.AuxiliaryCoordinate.cfa_del_file_substitution
724+
~cf.AuxiliaryCoordinate.cfa_file_substitutions
725+
~cf.AuxiliaryCoordinate.cfa_update_file_substitutions
726726
~cf.AuxiliaryCoordinate.chunk
727+
~cf.AuxiliaryCoordinate.del_file_location
727728
~cf.AuxiliaryCoordinate.delprop
728729
~cf.AuxiliaryCoordinate.expand_dims
730+
~cf.AuxiliaryCoordinate.file_locations
729731
~cf.AuxiliaryCoordinate.files
730732
~cf.AuxiliaryCoordinate.get_filenames
731733
~cf.AuxiliaryCoordinate.getprop

docs/source/class/cf.Bounds.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ NetCDF
418418
~cf.Bounds.nc_hdf5_chunksizes
419419
~cf.Bounds.nc_set_hdf5_chunksizes
420420

421-
CFA
422-
---
421+
Aggregation
422+
-----------
423423

424424
.. rubric:: Methods
425425

@@ -428,13 +428,8 @@ CFA
428428
:toctree: ../method/
429429
:template: method.rst
430430

431-
~cf.Bounds.add_file_location
432-
~cf.Bounds.cfa_clear_file_substitutions
433-
~cf.Bounds.cfa_del_file_substitution
434-
~cf.Bounds.cfa_file_substitutions
435-
~cf.Bounds.cfa_update_file_substitutions
436-
~cf.Bounds.del_file_location
437-
~cf.Bounds.file_locations
431+
~cf.Bounds.file_directories
432+
~cf.Bounds.replace_directory
438433

439434
Aliases
440435
-------
@@ -632,13 +627,21 @@ Deprecated
632627
:toctree: ../method/
633628
:template: method.rst
634629

630+
631+
~cf.Bounds.add_file_location
635632
~cf.Bounds.asdatetime
636633
~cf.Bounds.asreftime
637634
~cf.Bounds.attributes
635+
~cf.Bounds.cfa_clear_file_substitutions
636+
~cf.Bounds.cfa_del_file_substitution
637+
~cf.Bounds.cfa_file_substitutions
638+
~cf.Bounds.cfa_update_file_substitutions
638639
~cf.Bounds.chunk
640+
~cf.Bounds.del_file_location
639641
~cf.Bounds.delprop
640642
~cf.Bounds.dtvarray
641643
~cf.Bounds.expand_dims
644+
~cf.Bounds.file_locations
642645
~cf.Bounds.getprop
643646
~cf.Bounds.get_filenames
644647
~cf.Bounds.hasbounds
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.. currentmodule:: cf
2+
.. default-role:: obj
3+
4+
cf.BoundsFromNodesArray
5+
=======================
6+
7+
----
8+
9+
.. autoclass:: cf.BoundsFromNodesArray
10+
:no-members:
11+
:no-inherited-members:
12+
13+
.. rubric:: Methods
14+
15+
.. autosummary::
16+
:nosignatures:
17+
:toctree: ../method/
18+
:template: method.rst
19+
20+
~cf.BoundsFromNodesArray.__init__
21+
~cf.BoundsFromNodesArray.compressed_dimensions
22+
~cf.BoundsFromNodesArray.conformed_data
23+
~cf.BoundsFromNodesArray.copy
24+
~cf.BoundsFromNodesArray.get_attributes
25+
~cf.BoundsFromNodesArray.get_Subarray
26+
~cf.BoundsFromNodesArray.get_calendar
27+
~cf.BoundsFromNodesArray.get_cell_dimension
28+
~cf.BoundsFromNodesArray.get_compressed_axes
29+
~cf.BoundsFromNodesArray.get_compressed_dimension
30+
~cf.BoundsFromNodesArray.get_compression_type
31+
~cf.BoundsFromNodesArray.get_filenames
32+
~cf.BoundsFromNodesArray.get_node_coordinates
33+
~cf.BoundsFromNodesArray.get_start_index
34+
~cf.BoundsFromNodesArray.get_subspace
35+
~cf.BoundsFromNodesArray.get_units
36+
~cf.BoundsFromNodesArray.source
37+
~cf.BoundsFromNodesArray.subarray_parameters
38+
~cf.BoundsFromNodesArray.subarray_shapes
39+
~cf.BoundsFromNodesArray.subarrays
40+
~cf.BoundsFromNodesArray.to_dask_array
41+
~cf.BoundsFromNodesArray.to_memory
42+
43+
.. rubric:: Attributes
44+
45+
.. autosummary::
46+
:nosignatures:
47+
:toctree: ../attribute/
48+
:template: at
49+
50+
~cf.BoundsFromNodesArray.Units
51+
~cf.BoundsFromNodesArray.array
52+
~cf.BoundsFromNodesArray.compressed_array
53+
~cf.BoundsFromNodesArray.dtype
54+
~cf.BoundsFromNodesArray.ndim
55+
~cf.BoundsFromNodesArray.shape
56+
~cf.BoundsFromNodesArray.size
57+
58+

0 commit comments

Comments
 (0)