OceanNetworksCanada / api-python-client

Provides easy access to ONC data in Python
https://oceannetworkscanada.github.io/api-python-client/
Apache License 2.0
10 stars 9 forks source link

Issue 25 doctest for regression #34

Closed kan-fu closed 5 months ago

kan-fu commented 5 months ago

Fix #25. Internal time log at DMAS-79698.

Two tasks in this PR:

  1. Removed all the load_dotenv in the documentation (Code Examples and Tutorial). They can be misleading for new users who just want to know how to get started with the client library right away. Also used jupytext to convert all the code examples from ipynb to md. The choice of md over py format is that it is easier for sphinx-autobuild to pick up the change in real time. Changes about those code examples are auto generated by jupytext, which can be safely ignored during review. I still decided to keep the jupyter format for the tutorial because I think users might be interested to download and run the file locally.
  2. I also need to test those code based documentation (code examples, tutorial and docstring examples) in the internal monthly regression test. Files in tests/regression folder do not start with "test_". They are only intended for internal use.

I have to use some hack (might not be the most efficient way) to replace the dummy creation of onc object (onc=ONC("YOUR_TOKEN")) with the real token when running the files, and hide those real tokens back in the tutorial jupyter notebook, which was originally done by load_dotenv.