From 25c234beedb35988dc5431cee7b12b9237b620ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Wed, 27 May 2020 19:24:34 -0300 Subject: [PATCH 1/3] Reverting change from #1141 --- tardis/io/atom_data/base.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tardis/io/atom_data/base.py b/tardis/io/atom_data/base.py index 86cf25d09f4..8202ec8fcb4 100644 --- a/tardis/io/atom_data/base.py +++ b/tardis/io/atom_data/base.py @@ -216,9 +216,6 @@ def __init__(self, atom_data, ionization_data, levels=None, lines=None, # Convert energy to CGS levels.loc[:, "energy"] = Quantity(levels["energy"].values, 'eV').cgs - # Sort the dataframe before indexing to improve performance - lines.sort_index(inplace=True) - # Create a new columns with wavelengths in the CGS units lines.loc[:, 'wavelength_cm'] = Quantity( lines['wavelength'], 'angstrom').cgs From f637bfcb783d13cede88916393733e271ad7a79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Wed, 27 May 2020 20:01:45 -0300 Subject: [PATCH 2/3] Fix Qt GUI test --- tardis/gui/tests/test_gui.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tardis/gui/tests/test_gui.py b/tardis/gui/tests/test_gui.py index 16aa297c792..233b6ab40f4 100644 --- a/tardis/gui/tests/test_gui.py +++ b/tardis/gui/tests/test_gui.py @@ -1,28 +1,27 @@ +from PyQt5 import QtWidgets import os import pytest from tardis.io.config_reader import Configuration from tardis.simulation import Simulation import astropy.units as u -from tardis.gui.widgets import Tardis -from tardis.gui.datahandler import SimpleTableModel -from PyQt5 import QtWidgets - - +if 'QT_API' in os.environ: + from tardis.gui.widgets import Tardis + from tardis.gui.datahandler import SimpleTableModel @pytest.fixture(scope='module') def refdata(tardis_ref_data): def get_ref_data(key): return tardis_ref_data[os.path.join( - 'test_simulation', key)] + 'test_simulation', key)] return get_ref_data @pytest.fixture(scope='module') def config(): return Configuration.from_yaml( - 'tardis/io/tests/data/tardis_configv1_verysimple.yml') + 'tardis/io/tests/data/tardis_configv1_verysimple.yml') @pytest.fixture(scope='module') @@ -38,7 +37,8 @@ def simulation_one_loop( simulation.run() return simulation - + + @pytest.mark.skipif('QT_API' not in os.environ, reason="enviroment variable QT_API is not set") def test_gui(simulation_one_loop): simulation = simulation_one_loop From 9cd1787f7bab629be9d2e7bbd0ac4a04b2231397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Wed, 27 May 2020 20:15:13 -0300 Subject: [PATCH 3/3] Skip GUI test by removing QT_API env variable --- azure-pipelines/simple_test_framework.yml | 105 +++++++++++----------- 1 file changed, 50 insertions(+), 55 deletions(-) diff --git a/azure-pipelines/simple_test_framework.yml b/azure-pipelines/simple_test_framework.yml index 64d51a95bb7..96442f5f19e 100644 --- a/azure-pipelines/simple_test_framework.yml +++ b/azure-pipelines/simple_test_framework.yml @@ -3,66 +3,61 @@ # Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/python - trigger: -- master + - master variables: - system.debug: 'true' - ref.data.home: '$(Agent.BuildDirectory)/tardis-refdata' + system.debug: "true" + ref.data.home: "$(Agent.BuildDirectory)/tardis-refdata" - ref.data.github.url: 'https://github.com/tardis-sn/tardis-refdata.git' + ref.data.github.url: "https://github.com/tardis-sn/tardis-refdata.git" tardis.build.dir: $(Build.Repository.LocalPath) - - jobs: - -- job: 'Test' - pool: - vmImage: $[variables.vm_Image] - - strategy: - matrix: - linux: - vm_Image: 'Ubuntu-16.04' - conda: '/usr/share/miniconda' - mac: - vm_Image: 'macOS-10.14' - miniconda.url: 'http://repo.continuum.io/miniconda/Miniconda2-latest-mac-x86_64.sh' - maxParallel: 4 - - steps: - - bash: | + - job: "Test" + pool: + vmImage: $[variables.vm_Image] + + strategy: + matrix: + linux: + vm_Image: "Ubuntu-16.04" + conda: "/usr/share/miniconda" + mac: + vm_Image: "macOS-10.14" + miniconda.url: "http://repo.continuum.io/miniconda/Miniconda2-latest-mac-x86_64.sh" + maxParallel: 4 + + steps: + - bash: | echo "##vso[task.prependpath]$CONDA/bin" - displayName: Add conda to PATH - - - bash: | - sudo chown -R $USER $CONDA - # conda update -y conda - displayName: updating conda and activating - - - bash: | - sh ci-helpers/install_tardis_env.sh - displayName: 'Install TARDIS env' - - - bash: | - sh ci-helpers/fetch_reference_data.sh - displayName: 'Fetch Reference Data' - - - bash: | - source activate tardis - python setup.py build_ext --inplace - displayName: 'TARDIS build' - - - bash: | - source activate tardis - conda install -y pytest-cov - pip install git+https://github.com/tonybaloney/pytest-azurepipelines.git - export QT_API=pyqt - pytest tardis --tardis-refdata=$(ref.data.home) --cov=tardis --cov-report=xml --cov-report=html - - displayName: 'TARDIS test' - - script: | - bash <(curl -s https://codecov.io/bash) - displayName: 'Upload to codecov.io' + displayName: Add conda to PATH + + - bash: | + sudo chown -R $USER $CONDA + # conda update -y conda + displayName: updating conda and activating + + - bash: | + sh ci-helpers/install_tardis_env.sh + displayName: "Install TARDIS env" + + - bash: | + sh ci-helpers/fetch_reference_data.sh + displayName: "Fetch Reference Data" + + - bash: | + source activate tardis + python setup.py build_ext --inplace + displayName: "TARDIS build" + + - bash: | + source activate tardis + conda install -y pytest-cov + pip install git+https://github.com/tonybaloney/pytest-azurepipelines.git + pytest tardis --tardis-refdata=$(ref.data.home) --cov=tardis --cov-report=xml --cov-report=html + + displayName: "TARDIS test" + - script: | + bash <(curl -s https://codecov.io/bash) + displayName: "Upload to codecov.io"