-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Pyobis example notebook #115
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
pre-commit.ci autofix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments:
- In cell [5] you have a comment for the future. Maybe, to keep the notebook "clean," that could be an issue instead of a commented out cell.
- The tables tables in the notebook are quite big. If they are only for a quick data check/demo, maybe consider using just a few rows like
df_meta.head(5)
instead of all 45 rows. (Same in cell 11). - You don't need
plt.show()
in a notebook but it doesn't hurt to leave it there. - There seems to be some commented out debug print statement, consider removing them to improve the notebook readability.
- A comment that describes what is being done decreases readability instead of improving it I would remove the one at the top of cell 17 b/c the next cell is almost the same sentence in s highly legible code.
- Everything after cell 18 is commented out. If we cannot run maybe consider removing it.
@MathewBiddle you'll have to do a |
@ocefpaf I was hoping to only use pyobis for this notebook, but it wasn't quite ready yet. I made some work arounds and added some context. Let me know what you think. At the end of the notebook, what I tried to do is repeat this figure [1] from [2]. But, the latitudes on the map don't match the latitudes on the histogram (so I did some fiddling). We've tried figuring it out before, but never quite finished it up (see last cell in [3]. [2] - https://github.com/iobis/pyobis/blob/main/notebooks/biodiversity_mapping.ipynb [3] - https://github.com/MathewBiddle/bio_ice/blob/main/create_map_from_OBIS_API.ipynb |
@ocefpaf I think I addressed your comments. |
Some minor comments:
The notebook is great and is good to go IMO. When you are done on your side let me know so I can run pre-commit and conda-lock to update the packages in the CIs. PS: In notebooks we break the rule of imports at the top and usually import them at first cell that uses them to help show its use and track what is being used and what was abandoned along the way. |
Thanks for taking a look! cell [25] - The commented code is a search that would replace the This is a similar issue with cell[10] and cell[11]. Cell[10] is less code and should work, but the API limits responses to 10k. Cell[11] iterates dataset by dataset and concatenates them all together to give the true representation of points. So, my question to you is, do we leave both options in there? Or should we only show the one that gives the appropriate response? I do like having the imports where they are actually being used. I'll work through making those changes. Although, it will be odd with the various pyobis calls throughout the notebook. I'll see how it looks. |
I'd leave just the one that works, open an issue, and re-visit the notebook when/if we can the better option that doesn't work now.
B/c of the narrative in the notebook you "introduce" pyobis at the first use/import, so readers kind of expect it to show up again. At least that is how I read notebooks. |
This line f"Total aggregated occurrence records contributed to OBIS from the US MBON network as of {today}: {gdf_ghsh.records.sum() }" in in cell [18] is failing. I belive it was a shape there instead of a records sum. I'll fix that in my copy here and push. Also, the file |
Agreed. my mistake on that one. I was using that geojson in the map presented at https://marinebon.github.io/map-of-activities/. See But I could easily port code to do that in the marinebon map-of-activities repo. |
adding pyobis to env
for more information, see https://pre-commit.ci
creating high resolution map w/ histograms
I'm thinking we should remove cell 9 and the italicized text in the markdown above. That cell is only returning the first 10k entries and exemplifies the failing API response, not something we want to promote at the moment. |
Done! |
I'm okay with merging this! Thanks for all your help on this one! |
Just waiting the CIs to merge this one and #131. |
closes #106