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

JOSS Review: Installation and tests #1

Closed
nmstreethran opened this issue Sep 3, 2021 · 0 comments
Closed

JOSS Review: Installation and tests #1

nmstreethran opened this issue Sep 3, 2021 · 0 comments

Comments

@nmstreethran
Copy link

Hi @mfleschutz, I'm opening this issue as part of my JOSS review of elmada (openjournals/joss-reviews#3625). This issue concerns the installation and testing instructions outlined in the README file. I'll submit further issues for the other review checklist items where necessary. Please let me know if anything is unclear. Thanks!

Installation

conda recommends installing as many requirements as possible with conda before using pip. plotly, mypy, and entsoe-py=0.2.10 are all available on conda-forge, so you could add these to environment.yml as conda package requirements.

bs4 should be changed to beautifulsoup4; from bs4's description available at https://pypi.org/project/bs4/:

This is a dummy package managed by the developer of Beautiful Soup to prevent name squatting. The official name of PyPI’s Beautiful Soup Python package is beautifulsoup4. This package ensures that if you type pip install bs4 by mistake you will end up with Beautiful Soup.

You could consider adding instructions to install from source without conda (as well as using conda to create a non-development elmada environment) for completeness. I tried the following and did not encounter any additional issues:

git clone https://github.com/DrafProject/elmada.git
cd elmada
python3 -m venv env
source env/bin/activate
python -m pip install -e .[dev]
pytest

You could also consider adding installation instructions for Windows users:

git clone https://github.com/DrafProject/elmada.git
cd elmada
py -m venv env
.\env\Scripts\activate
py -m pip install -e .[dev]
pytest

Tests

The tests fail if you don't set-up ENTSO-E and Quandl API keys (3 failures). However, the instructions to set-up the API keys in the README are only available in the Usage section to enable live mode. The API keys should be a requirement for running tests as the tests will fail otherwise. Here's the short summary of the failures, for your reference:

========================== short test summary info ===========================
FAILED tests/test_from_entsoe.py::test_load_installed_generation_capacity - Exception: `entsoe.txt` file not found and ENTSOE_API_KEY not set.Plea...
FAILED tests/test_from_entsoe.py::test_load_el_national_generation - Exception: `entsoe.txt` file not found and ENTSOE_API_KEY not set.Please get...
FAILED tests/test_from_other.py::test_get_ice_eua_prices_without_cache - Exception: `quandl.txt` file not found and QUANDL_API_KEY not set.Please ...

I set the API keys as follows prior to running pytest, which fixed this issue:

python -c 'import elmada; elmada.set_api_keys(entsoe="YOUR_ENTSOE_KEY", morph="YOUR_MORPH_KEY", quandl="YOUR_QUANDL_KEY")'

Additionally, there were two warnings which should ideally be fixed:

============================== warnings summary ==============================
tests/test_cc_share.py::test_get_ccgt_shares_from_cascade
  /media/nms/Backups/Downloads/elmada/elmada/from_geo_via_morph.py:122: UserWarning: This pattern has match groups. To actually get the groups, use str.extract.
    contains_shutdown = df.name.str.contains("(Shutdown)")

tests/test_cc_share.py::test__scrape_geo_list
  /media/nms/Backups/Downloads/elmada/elmada/cc_share.py:147: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    df["capa"] = df["capa"].astype(np.float)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
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

1 participant