diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..3646706 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,17 @@ +[report] +exclude_lines = + pragma: no cover +omit = + *tests* +show_missing = True + +[html] +title = openalea.agroservices coverage report +directory = build/htmlcov + +[run] +source = openalea.agroservices +omit = + *__init__* + *test* + diff --git a/.cruft.json b/.cruft.json new file mode 100644 index 0000000..ebc5ad8 --- /dev/null +++ b/.cruft.json @@ -0,0 +1,23 @@ +{ + "template": "https://github.com/openalea/cookiecutter-openalea", + "commit": "0a5d3e9daaa57fd8f9668ac2d8ae07b741607a93", + "checkout": null, + "context": { + "cookiecutter": { + "full_name": "OpenAlea", + "email": "christophe.pradal@cirad.fr", + "github_username": "openalea", + "project_name": "agroservices", + "project_slug": "agroservices", + "description": "\"AgroService is a Python package that provides access to IPM Web Services (at least) and a framework to easily implement Web Services wrappers. This package is intended to be close to the webservice. Therefore the requests will have the same API that each web service.\"", + "pure_python": true, + "version": "1.0.1", + "_copy_without_render": [ + ".github/workflows/conda-package-build.yml" + ], + "_template": "https://github.com/openalea/cookiecutter-openalea", + "_commit": "0a5d3e9daaa57fd8f9668ac2d8ae07b741607a93" + } + }, + "directory": null +} diff --git a/.github/workflows/conda-package-build.yml b/.github/workflows/conda-package-build.yml deleted file mode 100644 index 80d4d19..0000000 --- a/.github/workflows/conda-package-build.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: build_publish_anaconda - -on: - push: - branches: - - '**' - tags: - - 'v*' - pull_request: - branches: - - '**' - -jobs: - build: - uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main - secrets: - anaconda_token: ${{ secrets.ANACONDA_TOKEN }} - diff --git a/.github/workflows/openalea_ci.yml b/.github/workflows/openalea_ci.yml new file mode 100644 index 0000000..b5d7773 --- /dev/null +++ b/.github/workflows/openalea_ci.yml @@ -0,0 +1,25 @@ +# your_package/.github/workflows/openalea_ci.yml + +name: OpenAlea CI + +on: + push: + branches: + - main + - master + tags: + - 'v*' + pull_request: + types: + - opened + - synchronize + - reopened + release: + types: + - published + +jobs: + build: + uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main + secrets: + anaconda_token: ${{ secrets.ANACONDA_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 96cd7aa..631cd18 100644 --- a/.gitignore +++ b/.gitignore @@ -1,112 +1,90 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ *.py[cod] -*$py.class - +.DS_Store # C extensions *.so -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg +# Packages *.egg +*.egg-info +build +eggs +.eggs +parts +var +sdist +develop-eggs +.installed.cfg +lib +lib64 MANIFEST -.vscode - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec # Installer logs pip-log.txt -pip-delete-this-directory.txt +npm-debug.log +pip-selfcheck.json # Unit test / coverage reports -htmlcov/ -.tox/ .coverage -.coverage.* -.cache +.tox nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ +htmlcov +.cache +.pytest_cache +.mypy_cache # Translations *.mo -*.pot -# Django stuff: -*.log -local_settings.py -db.sqlite3 +# Mr Developer +.mr.developer.cfg +.project +.pydevproject -# Flask stuff: -instance/ -.webassets-cache +# SQLite +test_exp_framework -# Scrapy stuff: -.scrapy +# npm +node_modules/ -# Sphinx documentation -doc/build/ -doc/source/references/generated +# dolphin +.directory +libpeerconnection.log -# PyBuilder -target/ +# setuptools +dist -# Jupyter Notebook -.ipynb_checkpoints +# IDE Files +atlassian-ide-plugin.xml +.idea/ +*.swp +*.kate-swp +.ropeproject/ -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ +# Python3 Venv Files +.venv/ +bin/ +include/ +lib/ +lib64 +pyvenv.cfg +share/ venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject +.python-version -# Rope project settings -.ropeproject +# Cython +*.c -# mkdocs documentation -/site +# Emacs backup +*~ -# mypy -.mypy_cache/ +# VSCode +/.vscode -# Mac -.DS_Store +# Automatically generated files +docs/preconvert +site/ +out -# Visual Code -*.code-workspace \ No newline at end of file +# Sphinx +_static +_build \ No newline at end of file diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index a06c1c5..0000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 - -sphinx: - configuration: doc/source/conf.py - -python: - version: 3.8 - install: - - method: setuptools - path: . - -conda: - environment: doc/environment.yml - diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..1ef0607 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,13 @@ +version: 2 + +build: + os: "ubuntu-22.04" + tools: + python: "mambaforge-22.9" + +conda: + environment: conda/environment.yml + +sphinx: + # Path to your Sphinx configuration file. + configuration: doc/conf.py \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..fd55058 --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,10 @@ +# Credits + +## Lead Developer + +- Marc Labadie, + +## Contributors + +- Christian Fournier, +- Christophe Pradal, diff --git a/AUTHORS.rst b/AUTHORS.rst deleted file mode 100644 index 9a613c5..0000000 --- a/AUTHORS.rst +++ /dev/null @@ -1,3 +0,0 @@ -* Fournier Christian (christian.fournier@inrae.fr) -* Christophe Pradal (christophe.pradal@cirad.fr) -* Marc Labadie (marc.labadie@inrae.fr) \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9e0e2bb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..260238e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contributing to agroservices + +Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. + +Please contribute by [reporting issues](https://github.com/openalea/agroservices/issues), [submitting pull requests](https://github.com/openalea/agroservices/pulls), or [providing feedback](https://github.com/openalea/agroservices/issues). diff --git a/LICENSE.txt b/LICENSE similarity index 99% rename from LICENSE.txt rename to LICENSE index 43ff90f..16e41fc 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -121,7 +121,7 @@ These expressions may be used both in singular and plural form. The purpose of the Agreement is the grant by the Licensor to the Licensee of a non-exclusive, transferable and worldwide license for the Software as set forth in Article 5 hereinafter for the whole term of the -protection granted by the rights over said Software. +protection granted by the rights over said Software. Article 3 - ACCEPTANCE @@ -267,7 +267,7 @@ When the Licensee creates Derivative Software, this Derivative Software may be distributed under a license agreement other than this Agreement, subject to compliance with the requirement to include a notice concerning the rights over the Software as defined in Article 6.4. -In the event the creation of the Derivative Software required modification +In the event the creation of the Derivative Software required modification of the Source Code, the Licensee undertakes that: 1. the resulting Modified Software will be governed by this Agreement, @@ -513,4 +513,4 @@ disagreements or disputes shall be referred to the Paris Courts having jurisdiction, by the more diligent Party. -Version 1.0 dated 2006-09-05. +Version 1.0 dated 2006-09-05. \ No newline at end of file diff --git a/README.md b/README.md index efdd49a..bbf01bf 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,46 @@ -[![Documentation Status](https://readthedocs.org/projects/agroservices/badge/?version=latest)](https://agroservices.readthedocs.io/en/latest/?badge=latest) -[![Anaconda-Server Badge](https://anaconda.org/openalea3/agroservices/badges/downloads.svg)](https://anaconda.org/openalea3/agroservices) -[![Anaconda-Server Badge](https://anaconda.org/openalea3/agroservices/badges/version.svg)](https://anaconda.org/openalea3/agroservices) -[![Anaconda-Server Badge](https://anaconda.org/openalea3/agroservices/badges/license.svg)](https://anaconda.org/openalea3/agroservices) # agroservices -**authors:** -* [Marc Labadie](https://github.com/mlabadie) -* [Christian Fournier](https://github.com/christian34) -* [Christophe Pradal](https://github.com/pradal) +_________________ + +[![Docs](https://readthedocs.org/projects/agroservices/badge/?version=latest)](https://agroservices.readthedocs.io/) +[![Build Status](https://github.com/openalea/agroservices/actions/workflows/conda-package-build.yml/badge.svg?branch=main)](https://github.com/openalea/agroservices/actions/workflows/conda-package-build.yml?query=branch%3Amaster) +[![License](https://img.shields.io/badge/License--CeCILL-C-blue)](https://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html) +[![Anaconda-Server Badge](https://anaconda.org/openalea3/agroservices/badges/version.svg)](https://anaconda.org/openalea3/agroservices) + +_________________ + +[Read Latest Documentation](https://agroservices.readthedocs.io/) - [Browse GitHub Code Repository](https://github.com/openalea/agroservices/) -**Institutes:** INRAE/CIRAD -**Licence:**[GPL-3](https://www.gnu.org/licenses/gpl-3.0.txt) -**Status:** python package -**Citation:**(DOI) +_________________ ## Description -AgroService is a Python package that provides access to IPM Web Services (at least) and a framework to easily implement Web Services wrappers. This package is intended to be close to the webservice. Therefore the requests will have the same API that each web service. The contract of agroservice is to wrap web services API into Python and to convert inputs and outputs. In the end, this package will provide transparent access to IPM Services in Python . It will allow OpenAlea to query and access data services, DSS catologue and thus execution of DSS models. +"AgroService is a Python package that provides access to IPM Web Services (at least) and a framework to easily implement Web Services wrappers. This package is intended to be close to the webservice. Therefore the requests will have the same API that each web service." ## Install -### Install conda -Follow official website instruction to install miniconda : http://conda.pydata.org/miniconda.html +### Install conda + +Follow official website instruction to install miniconda : ### User **Create a new environment with agroservices installed in there :** -``` + +```bash mamba create -n agroservices -c conda-forge -c openalea3 openalea.agroservices mamba activate agroservices ``` + **In an existing environment :** -``` + +```bash mamba install -c openalea3 -c conda-forge openalea.agroservices ``` ### From source -``` + +```bash # Install dependency with conda mamba create -n agroservices -f conda/environment.yml mamba activate agroservices @@ -51,7 +55,8 @@ cd test; pytest ``` ## Requirements -* python >= 3.6 + +* python >= 3.10 * appdirs * bs4 * colorlog @@ -60,18 +65,16 @@ cd test; pytest * pygments * jsf -## Documentation - -You can see the complete documentation with tutorials at: xxx - ## Contributing + All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. A detailed overview on how to contribute can be found in the [contributing guide](http://virtualplants.github.io/contribute/devel/workflow-github.html#workflow-github). -### contributors +### Contributors + +Thanks to all that ontribute making this package what it is ! - + - diff --git a/conda/environment.yml b/conda/environment.yml index de6c625..d551dce 100644 --- a/conda/environment.yml +++ b/conda/environment.yml @@ -1,13 +1,9 @@ -channel: +name: agroservices_dev +channels: - conda-forge + - openalea3 dependencies: - python - - appdirs - - bs4 - - pygments - - colorlog - - requests - - requests_cache - - pytest - - jsf - - six \ No newline at end of file + - pip + - pip: + - -e '..[test,dev,doc]' \ No newline at end of file diff --git a/conda/meta.yaml b/conda/meta.yaml index ee7acf1..fa7d095 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,45 +1,74 @@ -{% set version = "1.0.1"%} + +{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} +{% set name = pyproject.get('project').get('name') %} +{% set description = pyproject.get('project').get('description') %} +{% set version = environ.get('SETUPTOOLS_SCM_PRETEND_VERSION', "0.0.0.dev") %} +{% set license = pyproject.get('project').get('license') %} +{% set home = pyproject.get('project', {}).get('urls', {}).get('Homepage', '') %} +{% set build_deps = pyproject.get("build-system", {}).get("requires", []) %} +{% set deps = pyproject.get('project', {}).get('dependencies', []) %} +{% set conda_deps = pyproject.get('tool', {}).get('conda', {}).get('environment', {}).get('dependencies',[]) %} +{% set test_deps = pyproject.get('project', {}).get('optional-dependencies', {}).get('test',[]) %} + + package: - name: agroservices + name: {{ name }} version: {{ version }} + source: path: .. build: noarch: python - preserve_egg_dir: True number: 0 - script: python -m pip install . + preserve_egg_dir: True + + string: py{{ PY_VER }} + script: + - {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-build-isolation -vv requirements: + host: + - python + {% for dep in build_deps %} + - {{ dep }} + {% endfor %} + build: - - python {{PY_VER}} - - setuptools + - {{ compiler("cxx") }} + run: - - python >=3.6 - - appdirs - - bs4 - - pygments - - colorlog - - requests - - pyyaml - - requests_cache - - jsf + - python + {% for dep in deps + conda_deps %} + - {{ dep }} + {% endfor %} + + + test: - requires: - - pytest imports: - - agroservices + - openalea.agroservices + requires: + + {% for dep in test_deps %} + - {{ dep }} + {% endfor %} + source_files: - - test/** + - test/ commands: - - cd test - - pytest -v --ignore=test_weatherdata.py --ignore=test_dss.py + - pytest test/test_IPM.py + + about: - home: "https://github.com/openalea/agroservices" - license: GPL-v3 - summary: "AgroService is a Python package that provides access to IPM Web Services (at least) and a framework to easily implement Web Services wrappers." + home: {{ home }} + summary: {{ description }} + license: {{ license }} + +extra: + recipe-maintainers: + - OpenAlea \ No newline at end of file diff --git a/doc/Makefile b/doc/Makefile index d0c3cbf..8b08d3a 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,20 +1,248 @@ -# Minimal makefile for Sphinx documentation +# Makefile for Sphinx documentation # -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -BUILDDIR = build +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXATUOBUILD = sphinx-autobuild +PAPER = +BUILDDIR = _build -# Put it first so that "make" without argument is like "make help". +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " rtdhtml Build html using same settings used on ReadtheDocs" + @echo " livehtml Make standalone HTML files and rebuild the documentation when a change is detected. Also includes a livereload enabled web server" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " epub3 to make an epub3" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + @echo " dummy to check syntax errors of document sources" + +.PHONY: clean +clean: + rm -rf $(BUILDDIR)/* + rm -rf generated/* + rm -rf auto_gallery/ + +.PHONY: html +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: rtdhtml +rtdhtml: + $(SPHINXBUILD) -T -j auto -E -W --keep-going -b html -d $(BUILDDIR)/doctrees -D language=en . $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + + +.PHONY: livehtml +livehtml: + # @echo "$(SPHINXATUOBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html" + $(SPHINXATUOBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + +.PHONY: dirhtml +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +.PHONY: singlehtml +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +.PHONY: html-noplot +html-noplot: + $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: pickle +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +.PHONY: json +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +.PHONY: htmlhelp +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +.PHONY: qthelp +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/xarray.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xarray.qhc" + +.PHONY: applehelp +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +.PHONY: devhelp +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/xarray" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xarray" + @echo "# devhelp" + +.PHONY: epub +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +.PHONY: epub3 +epub3: + $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 + @echo + @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." + +.PHONY: latex +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +.PHONY: latexpdf +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: latexpdfja +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: text +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +.PHONY: man +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +.PHONY: texinfo +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +.PHONY: info +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +.PHONY: gettext +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +.PHONY: changes +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +.PHONY: linkcheck +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +.PHONY: doctest +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +.PHONY: coverage +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +.PHONY: xml +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." -.PHONY: help Makefile +.PHONY: pseudoxml +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) +.PHONY: dummy +dummy: + $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy + @echo + @echo "Build finished. Dummy builder generates no files." diff --git a/doc/api.md b/doc/api.md new file mode 100644 index 0000000..e1a4b56 --- /dev/null +++ b/doc/api.md @@ -0,0 +1,8 @@ +# API reference + +```{toctree} +:maxdepth: 2 +:hidden: + + +``` diff --git a/doc/source/conf.py b/doc/conf.py similarity index 84% rename from doc/source/conf.py rename to doc/conf.py index 94d8eb3..a8a6d4c 100644 --- a/doc/source/conf.py +++ b/doc/conf.py @@ -1,6 +1,15 @@ # -*- coding: utf-8 -*- import os import sys +from importlib.metadata import metadata + +pkg_name='agroservices' +meta = metadata('openalea.' + pkg_name) +release = meta.get("version") +# for example take major/minor +version = ".".join(release.split('.')[:3]) +author = meta['Author'].split(',')[0] + "et al." +desc = meta['Summary'] # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -28,6 +37,11 @@ "myst_parser", # for parsing .md files ] + +nbsphinx_thumbnails = { + 'examples/Segmentation': '_static/segmentation_thumb.png', +} + nbsphinx_allow_errors = True # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -42,17 +56,13 @@ # The master toctree document. master_doc = "index" # General information about the project. -project = "Agroservices" +project = pkg_name copyright = "Cecill-C INRAE / INRIA / CIRAD" -author = "Fournier Christian et al." +author = author # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = "1.0" -# The full version, including alpha/beta/rc tags. -release = "1.0.1" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # @@ -109,16 +119,16 @@ # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. html_show_copyright = True # Output file base name for HTML help builder. -htmlhelp_basename = "Agroservices_documentation" +htmlhelp_basename = "agroservices_documentation" # -- Options for LaTeX output --------------------------------------------- latex_elements = {} latex_documents = [ ( master_doc, - "Agroservices.tex", - "Agroservices Documentation", - "INRAe / INRIA / CIRAD", + "agroservices.tex", + "agroservices Documentation", + "INRA / INRIA / CIRAD", "manual", ), ] @@ -126,7 +136,7 @@ # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [(master_doc, "openalea.agroservices", "Agroservices Documentation", [author], 1)] +man_pages = [(master_doc, "openalea.agroservices", "agroservices Documentation", [author], 1)] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples @@ -135,13 +145,13 @@ texinfo_documents = [ ( master_doc, - "Agroservices", - "Agroservices Documentation", + "agroservices", + "agroservices Documentation", author, - "Agroservices", - "One line description of project.", + "agroservices", + "AgroService is a Python package that provides access to IPM Web Services (at least) and a framework to easily implement Web Services wrappers. This package is intended to be close to the webservice. Therefore the requests will have the same API that each web service.", "Miscellaneous", ), ] # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"python": ("https://docs.python.org/", None)} +intersphinx_mapping = {"python": ("https://docs.python.org/", None)} \ No newline at end of file diff --git a/doc/environment.yml b/doc/environment.yml deleted file mode 100644 index cfaa86e..0000000 --- a/doc/environment.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: agroservices -channels: - - conda-forge - -dependencies: - - python - - appdirs - - bs4 - - pygments - - colorlog - - requests - - requests_cache - - pytest - - pydata_sphinx_theme - - sphinx-favicon - - nbsphinx - - nbsphinx-link - - myst-parser diff --git a/example/quick_start.ipynb b/doc/examples/quick_start.ipynb similarity index 100% rename from example/quick_start.ipynb rename to doc/examples/quick_start.ipynb diff --git a/example/weather_ipm_interface.ipynb b/doc/examples/weather_ipm_interface.ipynb similarity index 100% rename from example/weather_ipm_interface.ipynb rename to doc/examples/weather_ipm_interface.ipynb diff --git a/doc/extra.md b/doc/extra.md new file mode 100644 index 0000000..6a957ee --- /dev/null +++ b/doc/extra.md @@ -0,0 +1,23 @@ +# Additional resources for agroservices + +```{include} ../CONTRIBUTING.md + :start-after: + :end-before +``` + +```{include} ../AUTHORS.md + :start-after: + :end-before +``` + +## License + +```{include} ../LICENSE + :start-after: + :end-before +``` + +```{include} ../CHANGELOG.md + :start-after: + :end-before +``` diff --git a/doc/index.md b/doc/index.md new file mode 100644 index 0000000..3e376fc --- /dev/null +++ b/doc/index.md @@ -0,0 +1,17 @@ +# agroservices + +## Official documentation for openalea.agroservices + +```{toctree} +:maxdepth: 2 +:hidden: + +Home +Install +Usage +API Reference +More +``` + +```{include} ../README.md +``` diff --git a/doc/installation.md b/doc/installation.md new file mode 100644 index 0000000..8abb4ec --- /dev/null +++ b/doc/installation.md @@ -0,0 +1,45 @@ +# Installation + +You must use conda environment : + +## Users + +### Create a new environment with agroservices installed in there + +```bash + +mamba create -n agroservices -c openalea3 -c conda-forge openalea.agroservices +mamba activate agroservices +``` + +Install agroservices in a existing environment + +```bash +mamba install -c openalea3 -c conda-forge openalea.agroservices +``` + +### (Optional) Test your installation + +```bash +mamba install -c conda-forge pytest +git clone https://github.com/openalea/agroservices.git +cd agroservices/test; pytest +``` + +## Developers + +### Install From source + +```bash +# Install dependency with conda +mamba env create -n agroservices -f conda/environment.yml +mamba activate agroservices + +# Clone agroservices and install +git clone https://github.com/openalea/agroservices.git +cd agroservices +pip install . + +# (Optional) Test your installation +cd test; pytest +``` diff --git a/doc/make.bat b/doc/make.bat deleted file mode 100644 index 9534b01..0000000 --- a/doc/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index 2933a78..0000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -appdirs -bs4 -colorlog -requests -requests_cache -pygments -nbsphinx -pydata_sphinx_theme -nbsphinx-link -myst-parser -sphinx-favicon \ No newline at end of file diff --git a/doc/source/_static/openalea_web.svg b/doc/source/_static/openalea_web.svg deleted file mode 100644 index 1e3527c..0000000 --- a/doc/source/_static/openalea_web.svg +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - OpenAlea - - - diff --git a/doc/source/index.rst b/doc/source/index.rst deleted file mode 100644 index 3e18fe3..0000000 --- a/doc/source/index.rst +++ /dev/null @@ -1,47 +0,0 @@ -.. agroservices documentation master file, created by - sphinx-quickstart on Tue Jun 8 18:49:28 2021. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to agroservices' documentation! -======================================== - -.. contents:: - -What is agroservices ? ----------------------- -AgroService is a Python package that provides access to IPM Web Services (at least) and a framework to easily implement Web Services wrappers. -This package is intended to be close to the webservice. -Therefore the requests will have the same API that each web service. -The contract of agroservices is to wrap web services API into Python and to convert inputs and outputs. -In the end, this package will provide transparent access to IPM Services in Python . -It will allow OpenAlea to query and access data services, DSS catalogue and thus execution of DSS models. - -Installation ------------- -.. toctree:: - ./install/index.rst - -Documentation -------------- - -Agroservices User Guide -'''''''''''''''''''''''' - -.. toctree:: - - ./user/index.rst - - -API References --------------- - -.. toctree:: - ./references/index.rst - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst deleted file mode 100644 index f49154c..0000000 --- a/doc/source/install/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -============ -Installation -============ - -.. toctree:: - :glob: - :caption: Install - - ./miniconda.rst - ./windows.rst - ./linux.rst \ No newline at end of file diff --git a/doc/source/install/linux.rst b/doc/source/install/linux.rst deleted file mode 100644 index feb08f8..0000000 --- a/doc/source/install/linux.rst +++ /dev/null @@ -1,60 +0,0 @@ -================================================= -Developer Install - Ubuntu (linux) -================================================= - -.. contents:: - -.. warning:: - This installation procedure is not fully tested. - -1. Install linux dependencies ------------------------------ -.. code:: shell - - sudo apt-get update - sudo apt-get install freeglut3-dev - -2. Miniconda installation -------------------------- - -Follow official website instruction to install miniconda : - -http://conda.pydata.org/miniconda.html - -3. Create virtual environment and activate it ---------------------------------------------- - -.. code:: shell - - conda create --name agroservices python - source activate agroservices - - -4. Install dependencies with conda ----------------------------------- - -.. code:: shell - - conda install -c conda-forge appdirs bs4 pygments colorlog requests requests_cache - -(Optional) Install several packages managing tools : - -.. code:: shell - - conda install -c conda-forge pytest sphinx sphinx_rtd_theme - -5. Install agroservices ------------------------ -.. code:: shell - - git clone https://github.com/H2020-IPM-openalea/agroservices.git - cd agroservices - python setup.py install - cd.. - -6. Test if installation is well installed (with pytest package) ---------------------------------------------------------------- -.. code:: shell - - cd agroservices\test - pytest \ No newline at end of file diff --git a/doc/source/install/miniconda.rst b/doc/source/install/miniconda.rst deleted file mode 100644 index 9ca3ed9..0000000 --- a/doc/source/install/miniconda.rst +++ /dev/null @@ -1,34 +0,0 @@ -================================================= -Installation with Miniconda (Windows, linux, OSX) -================================================= - -0. Install Miniconda --------------------- - -Follow official website instruction to install miniconda : - -http://conda.pydata.org/miniconda.html - -1. Install conda-build if not already installed ------------------------------------------------ - -.. code:: shell - - conda install conda-build - -2. Create virtual environment and activate it ---------------------------------------------- - -.. code:: shell - - conda create --name agroservice python - source activate agroservice - -1. Build and install agroservices package ------------------------------------------------- - -(Optional) Install several package managing tools : - -.. code:: shell - - conda install -c conda-forge notebook pythest sphinx sphinx_rtd_theme diff --git a/doc/source/install/windows.rst b/doc/source/install/windows.rst deleted file mode 100644 index e09caf1..0000000 --- a/doc/source/install/windows.rst +++ /dev/null @@ -1,51 +0,0 @@ -================================================= -Developer Install - Windows -================================================= - -.. contents:: - -1. Miniconda installation -------------------------- - -Follow official website instruction to install miniconda : - -http://conda.pydata.org/miniconda.html - -2. Create virtual environment and activate it ---------------------------------------------- - -.. code:: shell - - conda create --name agroservices python - conda activate agroservices - - -3. Install dependencies with conda ----------------------------------- - -.. code:: shell - - conda install -c conda-forge appdirs bs4 pygments colorlog requests requests_cache - -(Optional) Install several packages managing tools : - -.. code:: shell - - conda install -c conda-forge pytest sphinx sphinx_rtd_theme - -4. Install agroservices ------------------------ -.. code:: shell - - git clone https://github.com/H2020-IPM-openalea/agroservices.git - cd agroservices - python setup.py install - cd.. - -5. Test if installation is well installed (with pytest package) ---------------------------------------------------------------- -.. code:: shell - - cd agroservices\test - pytest - diff --git a/doc/source/references/agroservices.ipm.rst b/doc/source/references/agroservices.ipm.rst deleted file mode 100644 index da59155..0000000 --- a/doc/source/references/agroservices.ipm.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. currentmodule:: openalea.agroservices.ipm - -Agroservices IPM module -======================== - -.. automodule:: openalea.agroservices.ipm - :members: - :undoc-members: - :inherited-members: - :show-inheritance: \ No newline at end of file diff --git a/doc/source/references/agroservices.phis.rst b/doc/source/references/agroservices.phis.rst deleted file mode 100644 index 61db207..0000000 --- a/doc/source/references/agroservices.phis.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. currentmodule:: openalea.agroservices.phis - -Agroservices Phis module -======================== - -.. automodule:: openalea.agroservices.phis - :members: - :undoc-members: - :inherited-members: - :show-inheritance: \ No newline at end of file diff --git a/doc/source/references/index.rst b/doc/source/references/index.rst deleted file mode 100644 index 18502d5..0000000 --- a/doc/source/references/index.rst +++ /dev/null @@ -1,16 +0,0 @@ -API References -============== - -:Release: |release| -:Date: |today| - - -The exact API of all functions and classes, as given by the docstrings. The API -documents expected types and allowed features for all functions, and all -parameters available for the algorithms. - -.. toctree:: - - agroservices.ipm.rst - - agroservices.phis.rst \ No newline at end of file diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst deleted file mode 100644 index 3122c1d..0000000 --- a/doc/source/user/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. _agroservices_user: - -Agroservices IPM User Guide -############################ - -.. topic:: Summary - - :Version: |version| - :Release: |release| - :Date: |today| - -You can use agroservices to query on `IPM Decisions Service `_ - -* `IPM weather Services `_ -* `IPM DSS Services `_ - -.. toctree:: - :maxdepth: 1 - :numbered: - - quick_start - weather_ipm_interface \ No newline at end of file diff --git a/doc/source/user/quick_start.nblink b/doc/source/user/quick_start.nblink deleted file mode 100644 index 7f91cba..0000000 --- a/doc/source/user/quick_start.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../example/quick_start.ipynb" -} \ No newline at end of file diff --git a/doc/source/user/weather_ipm_interface.nblink b/doc/source/user/weather_ipm_interface.nblink deleted file mode 100644 index c6cdc40..0000000 --- a/doc/source/user/weather_ipm_interface.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../example/weather_ipm_interface.ipynb" -} \ No newline at end of file diff --git a/doc/usage.md b/doc/usage.md new file mode 100644 index 0000000..e64c34d --- /dev/null +++ b/doc/usage.md @@ -0,0 +1,6 @@ +# Usage + +```{nbgallery} +examples/quick_start.ipynb +examples/weather_ipm_interface.ipynb +``` diff --git a/pyproject.toml b/pyproject.toml index 6ce49d7..30d489c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,25 @@ [build-system] -requires = ["setuptools"] +requires = [ + "setuptools", + "setuptools_scm", +] build-backend = "setuptools.build_meta" +# where your source lies if you followed src layout +[tool.setuptools.packages.find] +where = ["src"] +include = ["openalea.*"] + +[tool.setuptools] +include-package-data = false # force explicit declaration of data (disable automatic inclusion) + +[tool.setuptools.package-data] +"openalea.agroservices" = ["data/**/*"] +"*" = ['*.json', '*.yaml'] + +# enable dynamic version based on git tags +[tool.setuptools_scm] + [project] name = "openalea.agroservices" authors = [ @@ -10,9 +28,11 @@ authors = [ { name = "Marc Labadie"}, { name = "Aurelien Besnier"}, ] -description = "AgroService is a Python package that provides access to IPM Web Services (at least) and a framework to easily implement Web Services wrappers. This package is intended to be close to the webservice. Therefore the requests will have the same API that each web service." -license.file = "LICENSE.txt" -requires-python = ">=3.8" +description = "FSPM tools for OpenAlea" +readme = "README.md" +license-files = ["LICENSE"] +requires-python = ">=3.10" +dynamic = ["version"] classifiers = [ "Intended Audience :: Science/Research", "Intended Audience :: Developers", @@ -24,9 +44,12 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering", ] -dynamic = ["version", "readme"] + +# you can list here all dependencies that are pip-instalable, and that have a name identical to the one used by conda (to allow reuse of this list in meta.yaml) +# If conda name is different, please do not declare the pip name, and declare conda name in the next section dependencies = [ "appdirs", "bs4", @@ -38,20 +61,30 @@ dependencies = [ "pyyaml" ] - [project.optional-dependencies] -test = ["pytest"] +test = [ + "pytest", + "nbmake", +] +dev = [ + "pytest >=6", + "pytest-cov >=3", +] +doc = [ + "sphinx-autobuild", + "pydata-sphinx-theme", + "myst-parser", + "sphinx-favicon", + "ipykernel", + "sphinx-copybutton", + "ipython_genutils", + "nbsphinx", +] [project.urls] -Homepage = "https://openalea.readthedocs.io/" +Repository = "https://github.com/openalea/agroservices" +Homepage = "https://agroservices.readthedocs.io/" "Bug Tracker" = "https://github.com/openalea/agroservices/issues" Discussions = "https://github.com/openalea/agroservices/discussions" Changelog = "https://github.com/openalea/agroservices/releases" -[tool.setuptools.packages.find] -where = ["src"] -include = ["openalea.*"] - -[tool.setuptools.dynamic] -version = {attr = "openalea.agroservices.__version__"} -readme = {file = ["README.md"]} diff --git a/src/openalea/agroservices/my_agroservice.json b/src/openalea/agroservices/my_agroservice.json new file mode 100644 index 0000000..ce66b82 --- /dev/null +++ b/src/openalea/agroservices/my_agroservice.json @@ -0,0 +1,6 @@ +{ + "myservice_1": { + "username": "Smith", + "password" : "foo" + } +} \ No newline at end of file diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/test_IPM.py b/test/test_IPM.py index a3c6ade..c396663 100644 --- a/test/test_IPM.py +++ b/test/test_IPM.py @@ -324,7 +324,7 @@ def test_run_model(): assert isinstance(res, dict) assert "locationResult" in res # fake input - input_data = fakers.input_data(model) - res = ipm.run_model(model, input_data) - assert isinstance(res, dict) - assert "locationResult" in res + #input_data = fakers.input_data(model) + #res = ipm.run_model(model, input_data) + #assert isinstance(res, dict) + #assert "locationResult" in res diff --git a/test/test_dss.py b/test/test_dss.py index 9fa38e0..f9b3bc0 100644 --- a/test/test_dss.py +++ b/test/test_dss.py @@ -112,7 +112,7 @@ def test_dss_field(dss, model): def test_run_model_field(): # input with field observation model = ipm.get_model(DSSId="no.nibio.vips", ModelId="PSILAROBSE") - path = datadir + "model_input_psilarobse.json" + path = datadir.datadir + "model_input_psilarobse.json" with open(path) as json_file: model_input = json.load(json_file) res = ipm.run_model(model, model_input) diff --git a/test/test_weatherdata.py b/test/test_weatherdata.py index ecf6c1f..371fea0 100644 --- a/test/test_weatherdata.py +++ b/test/test_weatherdata.py @@ -39,7 +39,7 @@ def is_weatherdata(res): ######################### Public WeatherAdaptaterService ####################### -@pytest.mark.parametrize("source_id", public_bylocation.keys()) +@pytest.mark.parametrize("source_id", list(public_bylocation)) def test_weatheradapter_public_bylocation(source_id): source = public_bylocation[source_id] params = weather_adapter_params(source) @@ -51,7 +51,7 @@ def test_weatheradapter_public_bylocation(source_id): raise ValueError(res) -@pytest.mark.parametrize("source_id", public_bystations.keys()) +@pytest.mark.parametrize("source_id", list(public_bystations)) def test_weatheradapter_public_bystations(source_id): source = public_bystations[source_id] params = weather_adapter_params(source) @@ -72,7 +72,7 @@ def test_weatheradapter_public_bystations(source_id): } -@pytest.mark.parametrize("source_id", private_bystations.keys()) +@pytest.mark.parametrize("source_id", list(private_bystations)) def test_weatheradapter_private_bystations(source_id): source = private_bystations[source_id] credentials = ipm_credentials[source_id]