Closed rebeccathomas-NOAA closed 2 months ago
@rebeccathomas-NOAA: thanks for reporting this! I have labeled this as a priority item and will try and get it fully addressed today with a complete patch, so there should be a pull request specifically addressing this in the next day or so. I am adding a checklist below for my internal tracking. I'll reach out if I have any clarification Q's on this Issue.
'inpfc'
in place of 'stratum_inpfc'
stratum = 'ks'
and stratum = 'inpfc'
pandas.DataFrameGroupBy
operations to ensure they are not hard-coded assuming stratum='ks'
Okay, thanks!
RT
I am having problems running survey.transect_analysis with a strata equals INPFC. I can get survey.transect_analysis() and survey.transect_analysis(stratum='ks') to run just fine. However, when I run survey.transect_analysis(stratum='inpfc'), I get the error:
Traceback (most recent call last): File "", line 1, in
File "C:\rthomas\Pycode\echopop\echopop\survey.py", line 188, in transect_analysis
self.analysis["transect"] = process_transect_data(
File "C:\rthomas\Pycode\echopop\echopop\analysis.py", line 80, in process_transect_data
aggregate_sigma_bs(
File "C:\rthomas\Pycode\echopop\echopop\acoustics.py", line 161, in aggregate_sigma_bs
aggregate_lengths = specimen_data.meld(
File "C:\rthomas\Pycode\echopop\echopop\utils\operations.py", line 180, in meld
specimen_dataframe.copy()
File "C:\rthomas\Pycode\Learn_EchoPop.venv\lib\site-packages\pandas\core\frame.py", line 9183, in groupby
return DataFrameGroupBy(
File "C:\rthomas\Pycode\Learn_EchoPop.venv\lib\site-packages\pandas\core\groupby\groupby.py", line 1329, in init
grouper, exclusions, obj = get_grouper(
File "C:\rthomas\Pycode\Learn_EchoPop.venv\lib\site-packages\pandas\core\groupby\grouper.py", line 1043, in get_grouper
raise KeyError(gpr)
KeyError: 'inpfc'
I realize that this could be a user error, so I apologize if raising it as an issue is the wrong thing to do. Thanks, Rebecca