population-trend 5.10.0__py3-none-any.whl → 5.10.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  """A population growth model package"""
2
2
 
3
- __version__ = "5.10.0"
3
+ __version__ = "5.10.1"
4
4
  from .calculate_growth_rates import * # noqa
5
5
  from .cli import * # noqa
6
6
  from .filter_data import * # noqa
@@ -13,7 +13,7 @@ class Plotter_Population_Trend_Model_From_CPUE(Plotter_Population_Trend_Model):
13
13
 
14
14
  def plot_data(self):
15
15
  plt.plot(
16
- self.plot_seasons,
16
+ self.seasons_to_plot,
17
17
  self.data[self.interest_variable],
18
18
  "-Dk",
19
19
  label="Maximum CPUE",
@@ -48,15 +48,23 @@ class Population_Trend_Model:
48
48
  class Plotter_Population_Trend_Model:
49
49
  def __init__(self, data, population_model, tick_mode):
50
50
  self.fig, self.ax = geci_plot()
51
- self.data = data
51
+ self.fill_missing_seasons(data)
52
52
  self.tick_mode = tick_mode
53
- self.ticks_text = self.data.Temporada.values.astype(int)
54
- self.ticks_positions = ticks_positions_array(self.data)
55
- self.plot_seasons = self.data.index.values + 1
53
+ self.seasons_to_plot = self.filled_data.index.values + 1
54
+ self.ticks_positions = ticks_positions_array(self.filled_data)
56
55
  self.plot_domain = np.linspace(self.ticks_positions.min(), self.ticks_positions.max(), 100)
57
56
  self.population_model = population_model
58
57
  self.interest_variable = population_model.interest_variable
59
58
 
59
+ def fill_missing_seasons(self, data):
60
+ self.data = data
61
+ self.data.Temporada = self.data.Temporada.astype(int)
62
+ self.data = self.data.set_index("Temporada")
63
+ full_seasons = range((self.data.index.min()), self.data.index.max() + 1)
64
+ self.filled_data = (
65
+ self.data.reindex(full_seasons).reset_index().rename(columns={"index": "Temporada"})
66
+ )
67
+
60
68
  def plot_smooth(self):
61
69
  self.ax.fill_between(
62
70
  self.plot_domain,
@@ -108,9 +116,9 @@ class Plotter_Population_Trend_Model:
108
116
  return self.fig
109
117
 
110
118
  def plot_data(self):
111
- plt.plot(
112
- self.plot_seasons,
113
- self.data[self.interest_variable],
119
+ self.ax.plot(
120
+ self.seasons_to_plot,
121
+ self.filled_data[self.interest_variable],
114
122
  "-Dk",
115
123
  label="Active Nests",
116
124
  )
@@ -144,6 +152,7 @@ class Plotter_Population_Trend_Model:
144
152
 
145
153
  def set_ticks(self):
146
154
  self.get_tick_step()
155
+ self.ticks_text = self.filled_data.Temporada.values.astype(int)
147
156
  plt.xticks(
148
157
  self.ticks_positions[:: self.tick_step],
149
158
  self.ticks_text[:: self.tick_step],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: population_trend
3
- Version: 5.10.0
3
+ Version: 5.10.1
4
4
  Summary: A population growth model package
5
5
  Home-page: https://github.com/IslasGECI/population_trend
6
6
  Author: Ciencia de Datos • GECI
@@ -0,0 +1,13 @@
1
+ population_trend/__init__.py,sha256=TkjYAYGUs5qD3YS0-vKhNCOzMvcymInP2K-54zG1F2k,317
2
+ population_trend/calculate_growth_rates.py,sha256=qD-a6O17CEhgKo0KmGzVGRpGuKpDQnno16MD3DgjVrk,6003
3
+ population_trend/cli.py,sha256=nSj4noSN7walhWoR02qUiSUx1LNIZsgD0MkeIdb4mI8,5534
4
+ population_trend/filter_data.py,sha256=D0Y1vztcbbo98af9q7wRhlHfH__bNFI8tnVOdJY6hu0,403
5
+ population_trend/plotter_growth_rate.py,sha256=jWMETGAahYNedyGJmxEzvjJdSNSPDsrpGlXrGIgDLQQ,1175
6
+ population_trend/plotter_population_trend_from_cpue.py,sha256=qXqqI-yDOMCx7LNCAQJz9Yaxbcw1IyS-dh-qyWBvMIs,1481
7
+ population_trend/population_growth_model.py,sha256=QKwxy4yOL00WVjhASwL_vz6WKzbgyOZWITQStjcm6J0,6456
8
+ population_trend/regional_lambdas.py,sha256=5eCRXf9RWS0c6BG5F-Exico0GNMuUNyexZ0ZJKgOmp4,5274
9
+ population_trend-5.10.1.dist-info/entry_points.txt,sha256=qVw9tnlMx7q2AnksVC2H4oK4ufQrdrbBzSODLH-bcac,61
10
+ population_trend-5.10.1.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
+ population_trend-5.10.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
12
+ population_trend-5.10.1.dist-info/METADATA,sha256=8MoyczHBwYEXw0cGVyZ4OtoFEBdubapm1mxR4bctATA,1353
13
+ population_trend-5.10.1.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- population_trend/__init__.py,sha256=WEnt5bUqsnO-BLEmO9jIKRoHh3tuHj0wyK7FxTP2yuk,317
2
- population_trend/calculate_growth_rates.py,sha256=qD-a6O17CEhgKo0KmGzVGRpGuKpDQnno16MD3DgjVrk,6003
3
- population_trend/cli.py,sha256=nSj4noSN7walhWoR02qUiSUx1LNIZsgD0MkeIdb4mI8,5534
4
- population_trend/filter_data.py,sha256=D0Y1vztcbbo98af9q7wRhlHfH__bNFI8tnVOdJY6hu0,403
5
- population_trend/plotter_growth_rate.py,sha256=jWMETGAahYNedyGJmxEzvjJdSNSPDsrpGlXrGIgDLQQ,1175
6
- population_trend/plotter_population_trend_from_cpue.py,sha256=Ig499pjnUdhkNs4rT71fkAU4j7RpLeqTNKX-JH1Ju_o,1478
7
- population_trend/population_growth_model.py,sha256=XftOLHs5cigocvU5GpUnwA6yWK-ospr8iSlIa0hEcyU,6003
8
- population_trend/regional_lambdas.py,sha256=5eCRXf9RWS0c6BG5F-Exico0GNMuUNyexZ0ZJKgOmp4,5274
9
- population_trend-5.10.0.dist-info/entry_points.txt,sha256=qVw9tnlMx7q2AnksVC2H4oK4ufQrdrbBzSODLH-bcac,61
10
- population_trend-5.10.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
- population_trend-5.10.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
12
- population_trend-5.10.0.dist-info/METADATA,sha256=OZsrguT89x12gQtmWrQsE7WwZlXywVvcHO0rlZxNz_g,1353
13
- population_trend-5.10.0.dist-info/RECORD,,