b3alien 0.3.0__tar.gz → 1.1.0__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.
Files changed (33) hide show
  1. {b3alien-0.3.0 → b3alien-1.1.0}/PKG-INFO +40 -1
  2. {b3alien-0.3.0 → b3alien-1.1.0}/README.md +39 -0
  3. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/b3cube/__init__.py +5 -1
  4. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/b3cube/b3cube.py +403 -42
  5. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/griis/__init__.py +9 -1
  6. b3alien-1.1.0/b3alien/griis/griis.py +619 -0
  7. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/simulation/__init__.py +5 -1
  8. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/simulation/simulation.py +143 -6
  9. b3alien-1.1.0/b3alien/utils/__init__.py +22 -0
  10. b3alien-1.1.0/b3alien/utils/geo.py +233 -0
  11. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien.egg-info/PKG-INFO +40 -1
  12. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien.egg-info/SOURCES.txt +1 -0
  13. {b3alien-0.3.0 → b3alien-1.1.0}/pyproject.toml +1 -1
  14. b3alien-1.1.0/tests/test_eea_grid.py +288 -0
  15. b3alien-1.1.0/tests/test_griis.py +265 -0
  16. {b3alien-0.3.0 → b3alien-1.1.0}/tests/test_occurrence_cube.py +4 -5
  17. {b3alien-0.3.0 → b3alien-1.1.0}/tests/test_solow_costello.py +73 -1
  18. b3alien-0.3.0/b3alien/griis/griis.py +0 -334
  19. b3alien-0.3.0/b3alien/utils/__init__.py +0 -14
  20. b3alien-0.3.0/b3alien/utils/geo.py +0 -36
  21. b3alien-0.3.0/tests/test_griis.py +0 -140
  22. {b3alien-0.3.0 → b3alien-1.1.0}/LICENSE +0 -0
  23. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/__init__.py +0 -0
  24. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/utils/runtime.py +0 -0
  25. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/visualisation/__init__.py +0 -0
  26. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/visualisation/b3gee.py +0 -0
  27. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien/visualisation/visualisation.py +0 -0
  28. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien.egg-info/dependency_links.txt +0 -0
  29. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien.egg-info/requires.txt +0 -0
  30. {b3alien-0.3.0 → b3alien-1.1.0}/b3alien.egg-info/top_level.txt +0 -0
  31. {b3alien-0.3.0 → b3alien-1.1.0}/setup.cfg +0 -0
  32. {b3alien-0.3.0 → b3alien-1.1.0}/tests/test_cube.py +0 -0
  33. {b3alien-0.3.0 → b3alien-1.1.0}/tests/test_simulation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: b3alien
3
- Version: 0.3.0
3
+ Version: 1.1.0
4
4
  Summary: Calculating the CBD target 6.1 indicator from occurrence cubes
5
5
  Author-email: Maarten Trekels <maarten.trekels@plantentuinmeise.be>
6
6
  License: MIT
@@ -132,6 +132,45 @@ In the above code block you need to replace the names of you locally saved files
132
132
 
133
133
  More information on this function can be found on the documentation website. However, if you don't need the geospatial mapping of your results, it is not needed to generate a GeoParquet file. The b3alien package also detects when a pure occurrence cube in CSV format is used.
134
134
 
135
+ #### Cubes on the EEA reference grid (no GeoPackage needed)
136
+
137
+ Cubes generated on the EEA reference grid (column `eeacellcode`, e.g. `1kmE2639N1762`) can be loaded directly from the GBIF download (CSV or zip). The cell polygons are computed from the cell codes in EPSG:3035, so no GeoParquet or GeoPackage is required:
138
+
139
+ ```python
140
+ from b3alien import b3cube
141
+
142
+ cube = b3cube.OccurrenceCube('PT_cube_mainland_new.zip', source='gbif')
143
+ cube.grid_type # 'eea'
144
+ cube.crs # 'EPSG:3035'
145
+
146
+ # Static map (matplotlib, EPSG:3035)
147
+ b3cube.plot_grid(cube) # the grid cells only
148
+ b3cube.plot_grid(cube, column='richness', log=True) # species richness
149
+ b3cube.plot_grid(cube, column='distinctobservers', log=True, # any cube column, summed per cell
150
+ cmap='YlOrRd', output_path='observers.png')
151
+
152
+ # Interactive map (folium)
153
+ b3cube.plot_grid(cube, column='richness', kind='interactive')
154
+
155
+ # GeoDataFrame per cell, for your own analyses
156
+ gdf = b3cube.grid_geodataframe(cube, column='richness')
157
+ ```
158
+
159
+ Lists of EEA cell codes can also be turned into geometries with `utils.eea_grid(codes)` or `utils.eea_cellcode_to_geometry(codes)`, and `utils.to_geoparquet(csvFile, leftID='eeacellcode')` writes a GeoParquet without a GeoPackage.
160
+
161
+ #### Cubes on the new GBIF taxonomic backbone
162
+
163
+ Cubes generated on the new GBIF backbone (Catalogue of Life eXtended Release) use alphanumeric keys (e.g. `CPZZL`). Download the GRIIS checklist in ColDP format from ChecklistBank and match it to the same backbone:
164
+
165
+ ```python
166
+ from b3alien import griis
167
+
168
+ griis.do_taxon_matching('GRIIS_PT_ColDP_extended.zip', output_dir='griis_pt')
169
+ CL = griis.CheckList('griis_pt/', use_profile=True, invasive_val='Invasive', habitat_val='Marine')
170
+ ```
171
+
172
+ This writes `merged_distr.txt` and `speciesprofile.txt` (derived from the ColDP `TaxonProperty` table), so `CheckList` works as for Darwin Core Archives. Synonyms are resolved to their accepted species, and infraspecific taxa to their species.
173
+
135
174
  ### Step 2: Download the GRIIS checklist of the considered country, and load it as a checklist object
136
175
 
137
176
  In this examplar workflow, we will use the checklist of Costa Rica, which is made available in the test data directory of the GitHub repository. However, you can download any of the checklists from GBIF.
@@ -96,6 +96,45 @@ In the above code block you need to replace the names of you locally saved files
96
96
 
97
97
  More information on this function can be found on the documentation website. However, if you don't need the geospatial mapping of your results, it is not needed to generate a GeoParquet file. The b3alien package also detects when a pure occurrence cube in CSV format is used.
98
98
 
99
+ #### Cubes on the EEA reference grid (no GeoPackage needed)
100
+
101
+ Cubes generated on the EEA reference grid (column `eeacellcode`, e.g. `1kmE2639N1762`) can be loaded directly from the GBIF download (CSV or zip). The cell polygons are computed from the cell codes in EPSG:3035, so no GeoParquet or GeoPackage is required:
102
+
103
+ ```python
104
+ from b3alien import b3cube
105
+
106
+ cube = b3cube.OccurrenceCube('PT_cube_mainland_new.zip', source='gbif')
107
+ cube.grid_type # 'eea'
108
+ cube.crs # 'EPSG:3035'
109
+
110
+ # Static map (matplotlib, EPSG:3035)
111
+ b3cube.plot_grid(cube) # the grid cells only
112
+ b3cube.plot_grid(cube, column='richness', log=True) # species richness
113
+ b3cube.plot_grid(cube, column='distinctobservers', log=True, # any cube column, summed per cell
114
+ cmap='YlOrRd', output_path='observers.png')
115
+
116
+ # Interactive map (folium)
117
+ b3cube.plot_grid(cube, column='richness', kind='interactive')
118
+
119
+ # GeoDataFrame per cell, for your own analyses
120
+ gdf = b3cube.grid_geodataframe(cube, column='richness')
121
+ ```
122
+
123
+ Lists of EEA cell codes can also be turned into geometries with `utils.eea_grid(codes)` or `utils.eea_cellcode_to_geometry(codes)`, and `utils.to_geoparquet(csvFile, leftID='eeacellcode')` writes a GeoParquet without a GeoPackage.
124
+
125
+ #### Cubes on the new GBIF taxonomic backbone
126
+
127
+ Cubes generated on the new GBIF backbone (Catalogue of Life eXtended Release) use alphanumeric keys (e.g. `CPZZL`). Download the GRIIS checklist in ColDP format from ChecklistBank and match it to the same backbone:
128
+
129
+ ```python
130
+ from b3alien import griis
131
+
132
+ griis.do_taxon_matching('GRIIS_PT_ColDP_extended.zip', output_dir='griis_pt')
133
+ CL = griis.CheckList('griis_pt/', use_profile=True, invasive_val='Invasive', habitat_val='Marine')
134
+ ```
135
+
136
+ This writes `merged_distr.txt` and `speciesprofile.txt` (derived from the ColDP `TaxonProperty` table), so `CheckList` works as for Darwin Core Archives. Synonyms are resolved to their accepted species, and infraspecific taxa to their species.
137
+
99
138
  ### Step 2: Download the GRIIS checklist of the considered country, and load it as a checklist object
100
139
 
101
140
  In this examplar workflow, we will use the checklist of Costa Rica, which is made available in the test data directory of the GitHub repository. However, you can download any of the checklists from GBIF.
@@ -16,6 +16,8 @@ from .b3cube import filter_multiple_occ
16
16
  from .b3cube import aggregate_count_per_cell
17
17
  from .b3cube import filter_time_window
18
18
  from .b3cube import find_correlations
19
+ from .b3cube import plot_grid
20
+ from .b3cube import grid_geodataframe
19
21
 
20
22
 
21
23
  __all__ = [
@@ -28,6 +30,8 @@ __all__ = [
28
30
  "get_survey_effort",
29
31
  "aggregate_count_per_cell",
30
32
  "filter_time_window",
31
- "find_correlations"
33
+ "find_correlations",
34
+ "plot_grid",
35
+ "grid_geodataframe",
32
36
  # purposely exclude OccurrenceCube
33
37
  ]