Skip to content
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

Update & add examples to work with Release 0.7.1 #157

Closed
aufdenkampe opened this issue Aug 30, 2018 · 13 comments
Closed

Update & add examples to work with Release 0.7.1 #157

aufdenkampe opened this issue Aug 30, 2018 · 13 comments

Comments

@aufdenkampe
Copy link
Member

aufdenkampe commented Aug 30, 2018

The existing examples were created by @sreeder about 1-2 years ago to work with releases 0.5 and 0.6.

It seems that none of the examples work with Release v0.7.1 and probably release 0.7.0 because of the major changes with those releases.

@emiliom, what would it take to update, replace or point to other working examples (via ReadMe) that function with the latest release?

@horsburgh or @miguelcleon, do you have any examples that work with the latest release?

cc: @roelofversteeg

Connected to #146 (comment)

@emiliom
Copy link
Member

emiliom commented Aug 30, 2018

@aufdenkampe I can do this next week. Shouldn't be a problem -- I will test and tweak this notebook from the BiGCZ workshop.

I'm on leave today and tomorrow.

@emiliom
Copy link
Member

emiliom commented Aug 31, 2018

@aufdenkampe A question about this:

It seems that none of the examples work with Release v0.7.1 and probably release 0.7.0 because of the major changes with those releases

It sounds like you're saying this not from direct testing of every example (including Miguel's notebooks), but from interpreting the impact of changes in releases 0.7.0 and 0.7.1, specially the simplification of the module hierarchy? If so, keep in mind that those major changes were implemented in such a way that they did not break old code. We created a "transition" when the old module reference hierarchy still works but is considered deprecated (it gives warnings), and the intent to remove it altogether in some future release.

So, most of the old code should still work fine, unless it's really old and fails for reasons involving changes in even older releases! It's simply not presenting the most up-to-date and future-proof module reference style.

Regardless, I agree that we should ensure the "official" examples presented in https://github.com/ODM2/ODM2PythonAPI/tree/master/Examples should always be tested to ensure they work with the latest release; and that's probably not the case with what's currently there. I'll work on that next week, and will probably remove some of those old examples.

Is this also worth updating?
https://big-cz.github.io/notebook_data_demo/notebooks/2017-06-24-odm2api_sample_fromsqlite/

Maybe. ODM2_Example3.ipynb largely superseded it, I think.

@aufdenkampe
Copy link
Member Author

cc: @erekalper & @dougvj, who work with @roelofversteeg

@aufdenkampe
Copy link
Member Author

@emiliom, it might also be worth adding to the top of the examples that ODM2PythonAPI is compatible with Python 3 since since Jan. 19, 2018 (Release 0.7, https://github.com/ODM2/ODM2PythonAPI/releases/tag/v0.7.0). Ideally we would ensure that the examples are also compatible with Python 3.

@aufdenkampe
Copy link
Member Author

@emiliom, in response to your #157 (comment), I think @erekalper & @dougvj & @roelofversteeg did do some direct testing, but that it didn't work. However, I don't know the details.

@erekalper & @dougvj & @roelofversteeg, could you let us know what worked and what didn't?

@emiliom
Copy link
Member

emiliom commented Sep 10, 2018

Pasting my comments from the email, and responding to this point:

@emiliom, it might also be worth adding to the top of the examples that ODM2PythonAPI is compatible with Python 3 since since Jan. 19, 2018 (Release 0.7, https://github.com/ODM2/ODM2PythonAPI/releases/tag/v0.7.0). Ideally we would ensure that the examples are also compatible with Python 3.

I'm tied up today and tomorrow and have only scanned these emails. But before a misunderstanding sets in, I want to clarify the status of Python 3 compatibility and ODM2PythonAPI. As far as I know it's not guaranteed to work with Python 3, nor has there been much testing against it. The text Anthony is quoting on https://github.com/ODM2/ODM2PythonAPI/releases/tag/v0.7.0 ("Python 3 Compatibility and Flake 8 Improvements", which I probably wrote myself) does not mean that it works with Python 3. Instead, it just says that improvements were made to the code to move towards Python 3 compatibility.

I don't recall anyone doing significant and sustained testing for Python 3 compatibility -- or any testing at all. You should assume that it's not compatible, and Python 2.7 is required.

@emiliom
Copy link
Member

emiliom commented Sep 15, 2018

@aufdenkampe Regarding the BiGCZ workshop odm2api notebook ODM2_Example3.ipynb: I've rerun (confirmed) and made small tweaks.

I first reran it with the "odm2client" conda env created for the workshop, and everything was fine. Then I created a new conda env using the same environment file, except for an important update: I removed the reference to the retired odm2 conda channel. I reran the notebook as is with this updated environment, and all its odm2api components ran w/o problem or updates, but the Folium map statement failed b/c of an update in a recent version. So, I fixed that. Everything ran.

But I went ahead and updated the odm2api code use to reflect recommended practices, specially to get rid of things that throw a warning b/c we've slated them to be deprecated (there were a bunch, involving mainly the import module hierarchy and a couple of parameter name changes). For good measure I also made a couple of cosmetic improvements for readability. I haven't pushed my updated notebook to any github repo yet.

We're slated to chat on Monday. Let's talk about this then, to decide what path to follow in updating the odm2api examples at https://github.com/ODM2/ODM2PythonAPI/tree/master/Examples. eg, we might want to:

@aufdenkampe
Copy link
Member Author

@emiliom, thanks for doing this and laying out possible next steps! Talk to you Monday!

@emiliom
Copy link
Member

emiliom commented Sep 24, 2018

I've cleaned up the Examples folder, via PR #160 (now merged into master). Removed old sample code, and added a new notebook, WaterQualityMeasurements_RetrieveVisualize.ipynb, that's an updated and polished version of https://github.com/BiG-CZ/wshp2017_tutorial_content/blob/master/notebooks/ODM2_Example3.ipynb (works with odm2api 0.7.1, uses current best practices, added more background info). Also added auxiliary files for that notebook: the SQLite ODM2 database and conda environment files used by the notebook.

I haven't made any changes to the Sphinx documentation yet. I'll get to that in a few days.

@emiliom
Copy link
Member

emiliom commented Oct 7, 2018

Added new notebook to Examples folder, via PR #162 (now merged into master). New notebook TimeSeries_RetrieveVisualize.ipynb complements the previously added one by focusing on a SQLite database with time series results. It's based on https://big-cz.github.io/notebook_data_demo/notebooks/2017-06-24-odm2api_sample_fromsqlite/ but with A LOT of cleanups, updates and polish. Made its organization and background info similar and consistent with the other notebook. Also added corresponding SQLite ODM2 database file.

@emiliom
Copy link
Member

emiliom commented Oct 18, 2018

@aufdenkampe I'm done with all the updates and changes identified in this issue. The Sphinx docs are now updated. Check them out, http://odm2.github.io/ODM2PythonAPI/. If you have suggestions for further changes, let's handle them via new issues.

@emiliom emiliom closed this as completed Oct 18, 2018
@aufdenkampe
Copy link
Member Author

@emiliom, wow! Thank you for substantially enhancing the documentation!
The Sphinx docs are much, much more helpful and the Example Jupyter notebooks are awesome! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants