Skip to content

Commit

Permalink
Refactor netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Feb 17, 2024
1 parent 86c0067 commit e3d0c40
Show file tree
Hide file tree
Showing 7 changed files with 519 additions and 437 deletions.
14 changes: 14 additions & 0 deletions climetlab/indexing/fieldset.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,17 @@ def __init__(self, *args, **kwargs):
class MultiFieldSet(FieldSet, MultiIndex):
def __init__(self, *args, **kwargs):
MultiIndex.__init__(self, *args, **kwargs)


class FieldArray(FieldSet):
def __init__(self, fields=None):
self.fields = fields if fields is not None else []

def append(self, field):
self.fields.append(field)

def _getitem(self, n):
return self.fields[n]

def __len__(self):
return len(self.fields)
Loading

0 comments on commit e3d0c40

Please sign in to comment.