From 1dce0897da4b1fe257e5ef47266d7b52d1fc8b50 Mon Sep 17 00:00:00 2001 From: davidmunoznovoa Date: Fri, 13 Oct 2023 11:54:43 +0200 Subject: [PATCH 1/4] Add 1367 indicator --- esios/indicators.py | 2 ++ spec/indicators_spec.py | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/esios/indicators.py b/esios/indicators.py index 9ebd63d..6b7d3e7 100644 --- a/esios/indicators.py +++ b/esios/indicators.py @@ -228,6 +228,8 @@ class mhpPowerFactorControl(Indicator): class mhpEnergyBalanceFree(Indicator): path = 'indicators/1366' +class mhpEnergyBalanceCUR(Indicator): + path = 'indicators/1367' class mhpEnergyBalanceInc(Indicator): path = 'indicators/1368' diff --git a/spec/indicators_spec.py b/spec/indicators_spec.py index d72903b..9ad1dc1 100644 --- a/spec/indicators_spec.py +++ b/spec/indicators_spec.py @@ -783,6 +783,18 @@ expect(data['indicator']['name']).to( contain(u'Precio medio horario componente incumplimiento energía de balance contratación libre') ) + with it('Returns mhpEnergyBalanceCUR instance'): + #1367 + e = Esios(self.token) + profile = mhpEnergyBalanceCUR(e) + assert isinstance(profile, mhpEnergyBalanceCUR) + data = profile.get(self.start_date, self.end_date) + expect(data['indicator']['short_name']).to( + equal(u'Incumplimiento energía balance CR') + ) + expect(data['indicator']['name']).to( + contain(u'Precio medio horario componente incumplimiento energía de balance comercialización de referencia') + ) with it('Returns mhpEnergyBalanceInc instance'): # 1368 e = Esios(self.token) From 0fa4163656c4d63d4f9cc7a12bdef502a2276ee8 Mon Sep 17 00:00:00 2001 From: davidmunoznovoa Date: Fri, 13 Oct 2023 11:57:19 +0200 Subject: [PATCH 2/4] Remove tests for older versions of Python3 --- .github/workflows/python3.10-app.yml | 36 ---------------------------- .github/workflows/python3.6-app.yml | 36 ---------------------------- .github/workflows/python3.7-app.yml | 36 ---------------------------- .github/workflows/python3.8-app.yml | 36 ---------------------------- .github/workflows/python3.9-app.yml | 36 ---------------------------- 5 files changed, 180 deletions(-) delete mode 100644 .github/workflows/python3.10-app.yml delete mode 100644 .github/workflows/python3.6-app.yml delete mode 100644 .github/workflows/python3.7-app.yml delete mode 100644 .github/workflows/python3.8-app.yml delete mode 100644 .github/workflows/python3.9-app.yml diff --git a/.github/workflows/python3.10-app.yml b/.github/workflows/python3.10-app.yml deleted file mode 100644 index 0d82b0c..0000000 --- a/.github/workflows/python3.10-app.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python 3.10 - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - pip install coveralls - pip install -e . - pip install --upgrade mamba - - name: Test with mamba - env: - ESIOS_TOKEN: ${{secrets.ESIOS_TOKEN}} - run: | - export ESIOS_TOKEN="$ESIOS_TOKEN" - mamba --enable-coverage \ No newline at end of file diff --git a/.github/workflows/python3.6-app.yml b/.github/workflows/python3.6-app.yml deleted file mode 100644 index 1c48ff4..0000000 --- a/.github/workflows/python3.6-app.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python 3.6 - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.6 - uses: actions/setup-python@v3 - with: - python-version: "3.6" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - pip install coveralls - pip install -e . - pip install --upgrade mamba - - name: Test with mamba - env: - ESIOS_TOKEN: ${{secrets.ESIOS_TOKEN}} - run: | - export ESIOS_TOKEN="$ESIOS_TOKEN" - mamba --enable-coverage \ No newline at end of file diff --git a/.github/workflows/python3.7-app.yml b/.github/workflows/python3.7-app.yml deleted file mode 100644 index b9fba14..0000000 --- a/.github/workflows/python3.7-app.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python 3.7 - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.7 - uses: actions/setup-python@v3 - with: - python-version: "3.7" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - pip install coveralls - pip install -e . - pip install --upgrade mamba - - name: Test with mamba - env: - ESIOS_TOKEN: ${{secrets.ESIOS_TOKEN}} - run: | - export ESIOS_TOKEN="$ESIOS_TOKEN" - mamba --enable-coverage \ No newline at end of file diff --git a/.github/workflows/python3.8-app.yml b/.github/workflows/python3.8-app.yml deleted file mode 100644 index a989d6c..0000000 --- a/.github/workflows/python3.8-app.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python 3.8 - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v3 - with: - python-version: "3.8" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - pip install coveralls - pip install -e . - pip install --upgrade mamba - - name: Test with mamba - env: - ESIOS_TOKEN: ${{secrets.ESIOS_TOKEN}} - run: | - export ESIOS_TOKEN="$ESIOS_TOKEN" - mamba --enable-coverage \ No newline at end of file diff --git a/.github/workflows/python3.9-app.yml b/.github/workflows/python3.9-app.yml deleted file mode 100644 index 2b599ff..0000000 --- a/.github/workflows/python3.9-app.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python 3.9 - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v3 - with: - python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - pip install coveralls - pip install -e . - pip install --upgrade mamba - - name: Test with mamba - env: - ESIOS_TOKEN: ${{secrets.ESIOS_TOKEN}} - run: | - export ESIOS_TOKEN="$ESIOS_TOKEN" - mamba --enable-coverage \ No newline at end of file From e24f2f08a12d95a423a9293cf56e2adec9107307 Mon Sep 17 00:00:00 2001 From: davidmunoznovoa Date: Fri, 13 Oct 2023 11:59:21 +0200 Subject: [PATCH 3/4] Fix Python 2.7 tests --- .github/workflows/python2.7-app.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python2.7-app.yml b/.github/workflows/python2.7-app.yml index 9fa3b93..8c3d3f2 100644 --- a/.github/workflows/python2.7-app.yml +++ b/.github/workflows/python2.7-app.yml @@ -16,10 +16,15 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 2.7 - uses: actions/setup-python@v2 - with: - python-version: "2.7" + - name: Install Python 2.7 + run: | + sudo apt update + sudo apt install python2 python-pip + sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 + printf '1\n' | sudo update-alternatives --config python + cd /usr/bin + sudo ln -s /usr/bin/pip2 ./pip - name: Install dependencies run: | python -m pip install --upgrade pip From 9035a526179f55b5caad8c4978a3316ec89ce898 Mon Sep 17 00:00:00 2001 From: davidmunoznovoa Date: Fri, 13 Oct 2023 12:04:15 +0200 Subject: [PATCH 4/4] Update README file --- README.rst | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/README.rst b/README.rst index 183166e..28bc87a 100644 --- a/README.rst +++ b/README.rst @@ -8,21 +8,6 @@ http://esios.readthedocs.org/ .. image:: https://github.com/gisce/esios/actions/workflows/python2.7-app.yml/badge.svg :target: https://github.com/gisce/esios/actions/workflows/python2.7-app.yml -.. image:: https://github.com/gisce/esios/actions/workflows/python3.6-app.yml/badge.svg - :target: https://github.com/gisce/esios/actions/workflows/python3.6-app.yml - -.. image:: https://github.com/gisce/esios/actions/workflows/python3.7-app.yml/badge.svg - :target: https://github.com/gisce/esios/actions/workflows/python3.7-app.yml - -.. image:: https://github.com/gisce/esios/actions/workflows/python3.8-app.yml/badge.svg - :target: https://github.com/gisce/esios/actions/workflows/python3.8-app.yml - -.. image:: https://github.com/gisce/esios/actions/workflows/python3.9-app.yml/badge.svg - :target: https://github.com/gisce/esios/actions/workflows/python3.9-app.yml - -.. image:: https://github.com/gisce/esios/actions/workflows/python3.10-app.yml/badge.svg - :target: https://github.com/gisce/esios/actions/workflows/python3.10-app.yml - .. image:: https://github.com/gisce/esios/actions/workflows/python3.11-app.yml/badge.svg :target: https://github.com/gisce/esios/actions/workflows/python3.11-app.yml