Skip to content

Commit

Permalink
tutorial and parts
Browse files Browse the repository at this point in the history
is_subset changed to method (nor property)
  • Loading branch information
MiguelonGonzalez committed Mar 2, 2022
1 parent c01f758 commit 86923c3
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 28 deletions.
9 changes: 4 additions & 5 deletions dinsar/parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def name(self, name):

assert isinstance(name, str), f"'{name}' no es un str."

if self.is_subset:
if self.is_subset():
self._name = name

else:
Expand All @@ -435,7 +435,6 @@ def gdf(self):
"""Devuelve un geopandas.GeoDataFrame con los puntos del dataset."""
return self._gdf

@property
def is_subset(self):
""" Devuelve True si este objeto no representa el Dataset original,
habiéndose recortado a los puntos indicados en el método 'subset'."""
Expand Down Expand Up @@ -475,7 +474,7 @@ def subset(self, puntos, vm=False):
>>> subset.puntos # Los puntos del Dataset se limitan a la selección.
['352866', '352918', '353090', '353378']
>>> subset.is_subset # ¿es 'subset' un recorte del Dataset original?
>>> subset.is_subset() # ¿es 'subset' un recorte del Dataset original?
>>> True
"""

Expand Down Expand Up @@ -779,7 +778,7 @@ def plot(self, points='all', savefig=False, **kwargs):
**kwargs Opcional
Se pasan a la función de representación de matplotlib a través
de pandas: DataFrame.plot(**kwargs)
de pandas: DataFrame.plot(**kwargs).
Devuelve
--------
Expand All @@ -798,7 +797,7 @@ def plot(self, points='all', savefig=False, **kwargs):
and points.lower() == 'all' else points

df = self.take(points).pivot(index='Fechas', columns='Nombre',
values='Valores')
values='Valores')

own_kwargs = dict(legend=True, title=name)
kwargs = _update_kwargs(own_kwargs, kwargs)
Expand Down
173 changes: 150 additions & 23 deletions examples/Working with model parts.ipynb

Large diffs are not rendered by default.

0 comments on commit 86923c3

Please sign in to comment.