Skip to content

Commit

Permalink
Merge 59c746c into ae9642f
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-neal committed Aug 20, 2018
2 parents ae9642f + 59c746c commit a976896
Show file tree
Hide file tree
Showing 18 changed files with 1,252 additions and 886 deletions.
46 changes: 44 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,52 @@ engines:
checks:
E501:
enabled: false

E203:
enbled: false
W503:
enabed: false
ratings:
paths:
- "**.py"

exclude_paths:
- tests/
# - tests/
- data/
- precision/
- venv/
- plots/

# Change check defaults
# https://docs.codeclimate.com/docs/advanced-configuration#section-default-check-configurations
version: "2" # required to adjust maintainability checks
checks:
argument-count:
config:
threshold: 6
complex-logic:
config:
threshold: 4
file-lines:
config:
threshold: 400
method-complexity:
config:
threshold: 10
method-count:
config:
threshold: 20
method-lines:
config:
threshold: 50
nested-control-flow:
config:
threshold: 4
return-statements:
config:
threshold: 4
# similar-code:
# config:
# threshold: # language-specific defaults. an override will affect all languages.
# identical-code:
# config:
# threshold: # language-specific defaults. an override will affect all languages.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ branch=True
omit =
# Omit large plotting function.
eniric/plotting_functions.py
data/*
plots/*
precision/*
1 change: 0 additions & 1 deletion .shippable.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- 3.5
- 3.6
- 3.7

Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
dist: xenial
sudo: true
language: python
python:
- "3.5"
- "3.6"
- 3.6
- 3.7

before_install:
# http://conda.pydata.org/docs/travis.html
Expand Down
3 changes: 0 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
environment:

matrix:
# For Python versions available on Appveyor, see
# http://www.appveyor.com/docs/installed-software#python
- PYTHON: "C:\\Python35"
- PYTHON: "C:\\Python36"
- PYTHON: "C:\\Python37"
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python37-x64"

Expand Down
47 changes: 47 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os

import astropy.units as u
import numpy as np
import pandas as pd
import pytest

Expand Down Expand Up @@ -67,3 +69,48 @@ def resampled_data(request):
)
wav, flux = pdread_2col(test_data)
return id_string, wav, flux


# Define some fixtures for Qcalculator.
per_s_cm2 = (1 / u.second) / (u.centimeter ** 2)


@pytest.fixture(
params=[
(np.arange(1, 101), np.random.random(100), None),
(np.linspace(2.1, 2.5, 200), np.random.random(200), np.random.random(200)),
(
np.linspace(0.5, 1.5, 50),
np.random.random(50),
np.floor(2 * np.random.random(50)),
),
]
)
def test_spec(request):
"""Wave and flux, mask examples."""
return request.param


# 3 situations each variable, no unit. a unit. or a dimensionless unscaled unit.
@pytest.fixture(params=[1, u.micron, u.dimensionless_unscaled])
def wav_unit(request):
"""Iterate some units on wavelength."""
return request.param


@pytest.fixture(params=[1, per_s_cm2, u.dimensionless_unscaled])
def flux_unit(request):
"""Iterate some units on flux"""
return request.param


@pytest.fixture(params=[1, u.dimensionless_unscaled])
def trans_unit(request):
"""Iterate some units on mask/transmission."""
return request.param


@pytest.fixture(params=[True, False])
def grad_flag(request):
"""Gradient flag parameter."""
return request.param
4 changes: 2 additions & 2 deletions docs/Notebooks/Molecfit_reference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@
"plt.plot(wl_input, mweight, 'r-', label='mweight')\n",
"#plt.plot(wl_input, input_flux, 'k-', label='input data')\n",
"plt.xlabel('Wavelength (microns and vacuum)')\n",
"plt.ylabel('Weigth')\n",
"plt.ylabel('weight')\n",
"plt.title(\"\")\n",
"plt.legend()\n",
"plt.show()\n",
Expand All @@ -576,7 +576,7 @@
"plt.plot(wl_input2, mweight2, 'r-', label='mweight2')\n",
"#plt.plot(wl_input, input_flux, 'k-', label='input data')\n",
"plt.xlabel('Wavelength (microns and vacuum)')\n",
"plt.ylabel('Weigth')\n",
"plt.ylabel('Weight')\n",
"plt.title(\"\")\n",
"plt.legend()\n",
"plt.show()\n",
Expand Down
383 changes: 383 additions & 0 deletions docs/Notebooks/Split_verse_Weighted_masking.ipynb

Large diffs are not rendered by default.

0 comments on commit a976896

Please sign in to comment.