-
Notifications
You must be signed in to change notification settings - Fork 5
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
WIP: Add Jupyter notebook analysis examples #1096
base: develop
Are you sure you want to change the base?
Conversation
…ect from external code later
… to display map of Platform/Datafile States
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## develop #1096 +/- ##
===========================================
- Coverage 80.10% 79.40% -0.70%
===========================================
Files 110 112 +2
Lines 11931 12092 +161
===========================================
+ Hits 9557 9602 +45
- Misses 2374 2490 +116
Continue to review full report at Codecov.
|
@robintw - would we get a live version of this if we added the Oops, I see we have a live version, even without the |
@robintw - I added the label to create the interactive preview. The preview loaded, but couldn't find |
Aah, one other change, please @robintw Can we move the notebook to the |
Ok, we can forget about using The only way to do it would be to put a REST wrapper around the database, but we don't have a justification for that right now. Never mind. Aah, or we connect to a local SQLite database. That would prevent the use of Update: I discussed the use of SQLite with @robintw - but he indicated that geopandas didn't support SQLite. Aah, hold on. It may be possible if conducted via the Source here |
Aah, one other piece of feedback. You're currently using the demonstrator to develop ways of plotting Pepys data. But, once it has started to mature, could you add inline code comments? I'm looking at |
Just a heads up @IanMayo that supporting the libraries we're using in Jupyter like Anyway, just a heads up. I will have a go at fixing it sometime, but at the moment I'll just focus on getting some interesting stuff done in the notebook, as playing with GDAL installs has already taken up far too much of my life (!). |
I've done some reading up on installing GDAL on Windows @robintw. It appears to be sensitive to the version of Python that is in use. Fortunately, we provide the local Python installation - so that takes one problem away. |
Aah, @robintw - I just did some research. Google Collab appears to allow connections to external Postgres databases. But, I can only load Aah :-(. It appears the user needs to be logged into Google to play the |
Notebook pushed now @IanMayo. It's definitely not tidy, but it should give an idea. The majority of the work of the 'find vessels within X distance' is implemented in a SQL query - the rest is just plumbing. |
I've done some more work on this to split the Jupyter demos out into separate notebooks in the The raw Jupyter notebooks don't really help you to get the 'full experience' as they need running to get any of their interactivity. You added the relevant extra requirements to the In the meantime, you can probably get the relevant dependencies installed ok on OS X or Linux if you want to try out the notebooks interactively. In terms of the work to deal with dependencies and also how to run Jupyter notebooks on Windows from the right folder, with the right modules: is that something we need to deal with now, or can it be left for the moment for these 'proof-of-concept' demos? They are all solvable problems, but I don't know whether I should spend time on them now, or focus more on showing the other stuff we can do within notebooks. Thoughts @IanMayo? |
Thanks @robintw . That's a puzzler. My gut feeling would be to push ahead with the examples - since that's where the innovation happens. But, I fear that would mean introducing technical debt that could grow as the examples get more diverse. So, please let's resolve the MS-Windows deployment issue. If our (your) work gets terminated then at least the analysts will have fully working examples to develop from. |
…he rest of the ecosystem
A quick update @IanMayo: I've now got the deployable release updated to include the required dependencies for Jupyter, and have added an option Pepys Admin to allow the user to start a Jupyter notebook server based in their home directory ( |
Also, an update on my pandas PR. It has been closed as apparently there is a duplicate PR, and they want to postpone this work to pandas 2.0. See here for details. |
Had a quick look, and the "duplicate" doesn't seem to offer as much value/improvement as yours does. I hope they come back & use your contribution. |
@IanMayo I've been working on the task to get interactive mapping working when disconnected from the internet. The first task was to make the folium library work offline - it usually downloads the JS/CSS files that are needed for the map (leaflet etc) from web-based CDNs. There was a bit of information online about making this work offline, but it was all rather nasty to use, and I have managed to tidy this up into a module called The way this works is that you do a simple import from offline_folium, and then this automatically sets up folium to load the JS/CSS from local files rather than remote files. To get these local files you can run the module on the command-line, which will download them into the package folders (we could run this during the 'create deployment' process). Once you've done the import, folium works as usual, and will work completely offline. I think it would be best to put this module in a separate repo. It needs to be a separate module because of how I've hooked into the module's import system to get it to alter things in folium. I also think that this could be a useful module to open-source, as others may find it useful - it's quite simple, but took a little while to get working correctly. What do you think? If you think this is a sensible way forward then could you create a repo called I haven't had as much time as I'd like to work on this recently, but my next plans are to tackle providing some sort of offline background mapping (GeoTIFFs of charts or GeoJSONs of coastlines) for the maps, and then to look at other ways of interactively exploring the data. |
Very rough work at the moment, and won't be merged in this state - but pushed so you can see the full notebooks
🧰 Issue
Fixes #1078
🚀 Overview:
🔗 Link to preview (or screenshot, if relevant)
🤔 Reason:
🔨Work carried out:
🖥️ Screenshot
Confirmations
interactive_review
if reviewers will need to see UI\docs
folderalembic revision
transitions📝 Developer Notes: