Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d5d1ef5
modify grts_cell to sample_frame_id, the real name
BryonLewis Apr 2, 2026
8705dcb
add species range model, management loading command, admin interface
BryonLewis Apr 2, 2026
4a9b595
GET species support for recordingId, GRTSCell and Sample_frame_Id for…
BryonLewis Apr 2, 2026
9291c8d
mark geojson file as generated to remove line count
BryonLewis Apr 2, 2026
c844931
mark geojson file as vendored to remove line count
BryonLewis Apr 2, 2026
37e1802
add category label back to Species results
BryonLewis Apr 3, 2026
4f2b7a9
Update .gitattributes
BryonLewis Apr 8, 2026
3b1e2fd
Update bats_ai/core/management/commands/load_species_geojson.py
BryonLewis Apr 8, 2026
6db3150
swap to tuples to lists for admin
BryonLewis Apr 8, 2026
b886db0
prevent nullable for SpeciesRange.source_feature_id field
BryonLewis Apr 8, 2026
7dfd479
update GEOJSON location, add loading to migration
BryonLewis Apr 8, 2026
14c969e
default to CONUS_SAMPLE_FRAME_ID=14 for unknown sample_frame_ids
BryonLewis Apr 8, 2026
1c6cae4
cleanup species view
BryonLewis Apr 8, 2026
5cfc201
pathlib for DEFAULT_GEOJSON
BryonLewis Apr 8, 2026
9bb636a
rename species.geojson to species-ranges.geojson
BryonLewis Apr 8, 2026
39bbdd3
Update bats_ai/core/management/commands/load_species_geojson.py
BryonLewis Apr 8, 2026
fadceef
allow more failing errors in load species range
BryonLewis Apr 8, 2026
a95324b
remove unecessary pk, and default to false if geom exists and overlap…
BryonLewis Apr 8, 2026
b048a59
in_range output comments, species-range ingestion description
BryonLewis Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
client/package-lock.json linguist-generated=true
bats_ai/core/data/species-ranges.geojson linguist-vendored=true
uv.lock linguist-generated=true
assets/example.wav filter=lfs diff=lfs merge=lfs -text
assets/model.mobilenet.onnx filter=lfs diff=lfs merge=lfs -text
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,18 @@ on all pipelines for new MRs. The automated checks in GitLab are optional, but
it is highly recommended to perform these checks locally prior to pushing new
commits.



### Spectrogram contours

Spectrogram processing tasks honor `DJANGO_BATAI_SAVE_SPECTROGRAM_CONTOURS` environment variable.
Spectrogram processing tasks honor `DJANGO_BATAI_SAVE_SPECTROGRAM_CONTOURS` environment variable.
Set to `False` by default so workers skip contour extraction (less DB storage space); set to `True` if you need
contours in the UI (UI for contours currently disabled due to performance)

### Species Suggestions by Range

The suggested species for a given location are determined by spatial data stored in `/bats_ai/core/data/species-range.geojson`.
As part of the default migrations this data is ingested into the SpeciesRange database and used for determining suggested
species based on a Recording (internal GRTS_Cell_ID and sample_frame_id).
The if the same species is found multiple times in the geojson the last geometry will be used.
In the future if species-ranges change the managment command of `./manage.py load_species_geojson [optional Geojson Path]`
can be used to reload the default species-range.geojson
if no path is provided or a new one and will update/replace any previous data.
2 changes: 2 additions & 0 deletions bats_ai/core/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .recording_tag import RecordingTagAdmin
from .sequence_annotations import SequenceAnnotationsAdmin
from .species import SpeciesAdmin
from .species_range import SpeciesRangeAdmin
from .spectrogram import SpectrogramAdmin
from .spectrogram_image import SpectrogramImageAdmin
from .user import UserAdmin
Expand All @@ -41,6 +42,7 @@
"RecordingTagAdmin",
"SequenceAnnotationsAdmin",
"SpeciesAdmin",
"SpeciesRangeAdmin",
"SpectrogramAdmin",
"SpectrogramImageAdmin",
"UserAdmin",
Expand Down
2 changes: 1 addition & 1 deletion bats_ai/core/admin/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RecordingAdmin(admin.ModelAdmin):
"comments",
"recording_location",
"grts_cell_id",
"grts_cell",
"sample_frame_id",
"site_name",
"detector",
"software",
Expand Down
23 changes: 23 additions & 0 deletions bats_ai/core/admin/species_range.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from __future__ import annotations

from django.contrib import admin
from django.contrib.gis.admin import GISModelAdmin

from bats_ai.core.models import SpeciesRange


@admin.register(SpeciesRange)
class SpeciesRangeAdmin(GISModelAdmin):
list_display = [
"id",
"species",
"source_feature_id",
]
list_select_related = ["species"]
search_fields = [
"species__species_code",
"species__common_name",
"source_feature_id",
]
autocomplete_fields = ["species"]
ordering = ["species__species_code"]
Loading