population-trend 5.10.0__tar.gz → 5.10.1__tar.gz
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.
- {population_trend-5.10.0 → population_trend-5.10.1}/PKG-INFO +1 -1
- {population_trend-5.10.0 → population_trend-5.10.1}/population_trend/__init__.py +1 -1
- {population_trend-5.10.0 → population_trend-5.10.1}/population_trend/plotter_population_trend_from_cpue.py +1 -1
- {population_trend-5.10.0 → population_trend-5.10.1}/population_trend/population_growth_model.py +16 -7
- {population_trend-5.10.0 → population_trend-5.10.1}/LICENSE +0 -0
- {population_trend-5.10.0 → population_trend-5.10.1}/README.md +0 -0
- {population_trend-5.10.0 → population_trend-5.10.1}/population_trend/calculate_growth_rates.py +0 -0
- {population_trend-5.10.0 → population_trend-5.10.1}/population_trend/cli.py +0 -0
- {population_trend-5.10.0 → population_trend-5.10.1}/population_trend/filter_data.py +0 -0
- {population_trend-5.10.0 → population_trend-5.10.1}/population_trend/plotter_growth_rate.py +0 -0
- {population_trend-5.10.0 → population_trend-5.10.1}/population_trend/regional_lambdas.py +0 -0
- {population_trend-5.10.0 → population_trend-5.10.1}/pyproject.toml +0 -0
{population_trend-5.10.0 → population_trend-5.10.1}/population_trend/population_growth_model.py
RENAMED
|
@@ -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
|
|
51
|
+
self.fill_missing_seasons(data)
|
|
52
52
|
self.tick_mode = tick_mode
|
|
53
|
-
self.
|
|
54
|
-
self.ticks_positions = ticks_positions_array(self.
|
|
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
|
-
|
|
112
|
-
self.
|
|
113
|
-
self.
|
|
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],
|
|
File without changes
|
|
File without changes
|
{population_trend-5.10.0 → population_trend-5.10.1}/population_trend/calculate_growth_rates.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|