diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml
index f5745cb78..27c887258 100644
--- a/.github/workflows/pip-install.yml
+++ b/.github/workflows/pip-install.yml
@@ -5,8 +5,21 @@ on:
jobs:
build_wheels:
- name: Build wheel
- runs-on: ubuntu-latest
+ name: Building wheel for ${{ matrix.os }}:Python-${{ matrix.python-version }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14]
+ python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
+ exclude:
+ - os: ubuntu-22.04
+ python-version: '3.6'
+ - os: macos-14
+ python-version: '3.6'
+ - os: macos-14
+ python-version: '3.7'
+ fail-fast: false
+
steps:
- uses: actions/checkout@v4
@@ -14,35 +27,50 @@ jobs:
id: setup_python
uses: actions/setup-python@v5
with:
- python-version: 3.9
-
- - uses: ilammy/msvc-dev-cmd@v1
+ python-version: ${{ matrix.python-version }}
- - name: Install cibuildwheel
+ - name: Install packages
run: |
- python -m pip install cibuildwheel==2.12.1
+ python -m pip install -U pip
+ python -m pip install setuptools
+ python -m pip install cibuildwheel
- - name: Build wheel
+ - name: Build wheel on Linux
+ if: runner.os == 'Linux'
run: |
- if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then
- python -m cibuildwheel --output-dir wheelhouse
- else
- echo "$RUNNER_OS not supported"
- exit 1
- fi
+ python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp3?-*'
- CIBW_SKIP: '*-manylinux_i686'
+ CIBW_SKIP: '*-manylinux_i686'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
- shell: bash
- - uses: actions/upload-artifact@v3
+ - name: Build wheel on macOS
+ if: runner.os == 'macOS'
+ run: |
+ python -m cibuildwheel --output-dir wheelhouse
+
+ - name: Upload wheel artifact
+ uses: actions/upload-artifact@v4
with:
- path: ./wheelhouse/*.whl
+ name: wheel-${{ matrix.os }}-${{ matrix.python-version }}
+ path: ./wheelhouse/
build_sdist:
- name: Build source distribution
- runs-on: ubuntu-latest
+ name: Building source for ${{ matrix.os }}:Python-${{ matrix.python-version }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14]
+ python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
+ exclude:
+ - os: ubuntu-22.04
+ python-version: '3.6'
+ - os: macos-14
+ python-version: '3.6'
+ - os: macos-14
+ python-version: '3.7'
+ fail-fast: false
+
steps:
- uses: actions/checkout@v4
with:
@@ -52,27 +80,92 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
- python-version: 3.9
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install packages
+ run: |
+ python -m pip install -U pip
+ python -m pip install setuptools
- name: Build sdist
run: python setup.py sdist
- - uses: actions/upload-artifact@v4
+ - name: Upload sdist artifact
+ uses: actions/upload-artifact@v4
with:
- path: dist/*.tar.gz
+ name: sdist-${{ matrix.os }}-${{ matrix.python-version }}
+ path: dist/
upload_pypi:
needs: [build_wheels, build_sdist]
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
+
steps:
- - uses: actions/download-artifact@v4
- with:
- name: artifact
+ - uses: actions/download-artifact@v4
+ with:
+ name: wheel-ubuntu-20.04-3.6.whl
+ path: wheelhouse
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: wheel-ubuntu-22.04-*
+ path: wheelhouse
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: wheel-macos-12-*
+ path: wheelhouse
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: wheel-macos-13-*
+ path: wheelhouse
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: wheel-macos-14-*
+ path: wheelhouse
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: sdist-ubuntu-20.04-*
+ path: dist
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: sdist-ubuntu-22.04-*
+ path: dist
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: sdist-macos-12-*
+ path: dist
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: sdist-macos-13-*
+ path: dist
+
+ - uses: actions/download-artifact@v4
+ with:
+ name: sdist-macos-14-*
path: dist
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ python -m pip install twine
+
+ - name: Upload to PyPI
+ if: github.repository == 'VirtualPlanetaryLaboratory/vplanet'
+ run: python -m twine upload dist/* wheelhouse/*
+ env:
+ TWINE_USERNAME: __token__
+ TWINE_PASSWORD: ${{ secrets.pypi_password }}
+
# Only push to PyPI if we're on the public repo!
- - uses: pypa/gh-action-pypi-publish@release/v1
- if: (!github.event.release.prerelease) && github.event_name == 'release' && github.event.action == 'published' && github.repository == 'VirtualPlanetaryLaboratory/vplanet'
- with:
- user: __token__
- password: ${{ secrets.pypi_password }}
+ # - uses: pypa/gh-action-pypi-publish@release/v1
+ # if: (!github.event.release.prerelease) && github.event_name == 'release' && github.event.action == 'published' && github.repository == 'VirtualPlanetaryLaboratory/vplanet'
+ # with:
+ # user: __token__
+ # password: ${{ secrets.pypi_password }}
diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml
index d85f2da4a..aab048fc1 100644
--- a/.github/workflows/sanitizer.yml
+++ b/.github/workflows/sanitizer.yml
@@ -7,8 +7,8 @@ on:
jobs:
sanitizer:
- name: Run address-sanitizer on Ubuntu
- runs-on: ubuntu-latest
+ name: Run address-sanitizer on macOS
+ runs-on: macos-13
strategy:
fail-fast: false
diff --git a/.github/workflows/tests-linux.yml b/.github/workflows/tests-linux.yml
index e7053fd1a..9ea95a810 100644
--- a/.github/workflows/tests-linux.yml
+++ b/.github/workflows/tests-linux.yml
@@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
- python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
+ python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: ubuntu-22.04
python-version: '3.6'
@@ -46,32 +46,28 @@ jobs:
shell: bash -l {0}
run: |
make opt
- pytest --tb=short
+ pytest --tb=short --junitxml=junit/test-results.xml
- - name: Check test ouptut created
+ - name: Check test output created
id: check_test_file
uses: andstor/file-existence-action@v3
with:
- files: "/home/runner/work/vplanet/vplanet/junit/test-results.xml"
+ files: "${{ github.workspace }}/junit/test-results.xml"
fail: true
- - name: Generate coverage
- id: coverage
- if: steps.test.outcome == 'success' && steps.check_test_file.outcome == 'success'
- run: make coverage
-
- - name: Get unique id
- uses: Tiryoh/gha-jobid-action@v1
- id: jobs
-
- name: Publish unit test results
+ if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' }}
uses: EnricoMi/publish-unit-test-result-action@v2
- if: always()
with:
files: junit/test-*.xml
- - name: CodeCov
- if: ${{ matrix.os }} == ubuntu-22.04 && ${{ matrix.python-version }} == '3.9'
+ - name: Generate coverage
+ id: coverage
+ if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' && steps.test.outcome == 'success' && steps.check_test_file.outcome == 'success' }}
+ run: make coverage
+
+ - name: Upload to CodeCov
+ if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.github/workflows/tests-macos-intel.yml b/.github/workflows/tests-macos-intel.yml
index 243088828..cbf2313db 100644
--- a/.github/workflows/tests-macos-intel.yml
+++ b/.github/workflows/tests-macos-intel.yml
@@ -10,8 +10,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [macos-11, macos-12, macos-13]
- python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
+ os: [macos-12, macos-13]
+ python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: false
steps:
- uses: actions/checkout@v4
@@ -35,8 +35,11 @@ jobs:
if: steps.setup_python.outcome == 'success'
run: |
make opt
- pytest --tb=short
+ pytest --tb=short --junitxml=junit/test-results.xml
- - name: Get unique id
- uses: Tiryoh/gha-jobid-action@v1
- id: jobs
+ - name: Check test ouptut created
+ id: check_test_file
+ uses: andstor/file-existence-action@v3
+ with:
+ files: "${{ github.workspace }}/junit/test-results.xml"
+ fail: true
diff --git a/.github/workflows/tests-macos-silicon.yml b/.github/workflows/tests-macos-silicon.yml
index 283278d1a..3b973c6df 100644
--- a/.github/workflows/tests-macos-silicon.yml
+++ b/.github/workflows/tests-macos-silicon.yml
@@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [macos-14]
- python-version: ['3.10', '3.11']
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: false
steps:
- uses: actions/checkout@v4
@@ -35,8 +35,12 @@ jobs:
if: steps.setup_python.outcome == 'success'
run: |
make opt
- pytest --tb=short
+ pytest --tb=short --junitxml=junit/test-results.xml
+
+ - name: Check test ouptut created
+ id: check_test_file
+ uses: andstor/file-existence-action@v3
+ with:
+ files: "${{ github.workspace }}/junit/test-results.xml"
+ fail: true
- - name: Get unique id
- uses: Tiryoh/gha-jobid-action@v1
- id: jobs
diff --git a/.gitignore b/.gitignore
index 786b156fd..500e18555 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@ tests/Vspace_Log/Log_Test/
*BP_CreateHDF5*
*BP_Extract*
*BP_Stats*
+junit/
coverage.info
.coverage
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 000000000..5f8079998
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,3 @@
+include VERSION
+include src/*.c
+include src/*.h
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 91a9d1723..8e36d81f8 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ legacy:
@echo "=========================================================================================================="
debug:
- -gcc -g -D DEBUG -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
+ -gcc -g -D DEBUG -Wunused-but-set-variable -Wunused-variable -Wfloat-equal -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
debug_no_AE:
-gcc -g -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
@@ -51,6 +51,9 @@ opt:
cpp:
g++ -o bin/vplanet src/*.c -lm -O3 -fopenmp -fpermissive -w -DGITVERSION=\"$(GITVERSION)\"
+warnings:
+ clang -Weverything src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
+
parallel:
gcc -o bin/vplanet src/*.c -lm -O3 -fopenmp -DGITVERSION=\"$(GITVERSION)\"
@@ -68,9 +71,12 @@ test:
-pytest --tb=short
coverage:
- -mkdir -p gcov && cd gcov && gcc -coverage -o ../bin/vplanet ../src/*.c -lm
- -python -m pytest --tb=short tests --junitxml=junit/test-results.xml
- -lcov --capture --directory gcov --output-file .coverage && genhtml .coverage --output-directory gcov/html
+ -rm -f ./gcov/*.gcda ./gcov/*.gcno ./.coverage
+ -mkdir -p ./gcov
+ -cd gcov && gcc -coverage -o ./../bin/vplanet ./../src/*.c -lm
+ -python -m pytest --tb=short tests --junitxml=./junit/test-results.xml
+ -lcov --capture --directory ./gcov --output-file ./.coverage
+ -genhtml ./.coverage --output-directory ./gcov/html
docs:
-make -C docs html && echo 'Documentation available at `docs/.build/html/index.html`.'
diff --git a/README.md b/README.md
index 2163d5af6..c7effb7b2 100644
--- a/README.md
+++ b/README.md
@@ -23,18 +23,18 @@
-
+
-
-
+
+
-
+
-
+
diff --git a/VERSION b/VERSION
index da6b0a8f1..5cdd6f64c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.5.6
+2.5.31
diff --git a/setup.py b/setup.py
index 366ff4c37..64fbc43bb 100644
--- a/setup.py
+++ b/setup.py
@@ -1,16 +1,12 @@
-import imp
import os
-import subprocess as sub
import sys
-from distutils.command.clean import clean
from glob import glob
-
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
from setuptools.command.develop import develop
# Read current code version
-VersionPath = os.path.join(os.path.abspath("."), "VERSION")
+VersionPath = os.path.join(os.path.abspath(os.path.dirname(__file__)), "VERSION")
VERSION = open(VersionPath, "r").read().split("\n")[0].strip()
@@ -37,10 +33,10 @@ class Develop(develop):
"""Custom develop command that clears build cache before install."""
def run(self):
- c = clean(self.distribution)
- c.all = True
- c.finalize_options()
- c.run()
+ # c = clean(self.distribution)
+ # c.all = True
+ # c.finalize_options()
+ # c.run()
develop.run(self)
@@ -94,6 +90,9 @@ def run(self):
ext_modules=ext_modules,
cmdclass=cmdclass,
include_package_data=True,
+# package_data={'': ['VERSION']},
+ package_data={'': ['src/*.[ch]']},
+ data_files=[('', ['VERSION'])],
zip_safe=False,
entry_points={"console_scripts": ["vplanet=vplanet.wrapper:_entry_point"]},
)
diff --git a/src/atmesc.c b/src/atmesc.c
index cef384139..979afe37e 100644
--- a/src/atmesc.c
+++ b/src/atmesc.c
@@ -903,7 +903,6 @@ Initialize the user options for the atmospheric escape model.
@param fnRead Array of pointers to the functions that read in the options
*/
void InitializeOptionsAtmEsc(OPTIONS *options, fnReadOption fnRead[]) {
- int iOpt, iFile;
fvFormattedString(&options[OPT_XFRAC].cName, "dXFrac");
fvFormattedString(&options[OPT_XFRAC].cDescr, "Fraction of planet radius in X-ray/UV");
@@ -1791,7 +1790,7 @@ void fnPropsAuxAtmEsc(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update,
// Diffusion-limited H escape rate
double BDIFF = 4.8e19 * pow(body[iBody].dFlowTemp, 0.75);
- if (XO == 1) {
+ if (fbFloatComparison(XO,1)) {
body[iBody].dFHDiffLim = 0;
} else {
body[iBody].dFHDiffLim =
@@ -1799,7 +1798,7 @@ void fnPropsAuxAtmEsc(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update,
(KBOLTZ * body[iBody].dFlowTemp * (1. + XO / (1. - XO)));
}
- if (body[iBody].dOxygenMass == 0) {
+ if (fbFloatComparison(body[iBody].dOxygenMass,0)) {
body[iBody].dOxygenEta = 0;
}
@@ -1841,7 +1840,6 @@ void fnPropsAuxAtmEsc(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update,
double x = (QOH - 1.) * (1. - XO) * (BDIFF * g * ATOMMASS) /
(KBOLTZ * body[iBody].dFlowTemp);
- double FH;
double rat;
// Get the crossover mass
@@ -1853,7 +1851,6 @@ void fnPropsAuxAtmEsc(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update,
(1. / (1. - XO)) *
(KBOLTZ * body[iBody].dFlowTemp * body[iBody].dFHRef) /
(BDIFF * g);
- FH = body[iBody].dFHRef;
/* Is this necessary? XXX
rat = ((body[iBody].dCrossoverMass / ATOMMASS) - QOH) /
((body[iBody].dCrossoverMass / ATOMMASS) - 1.);
@@ -1868,10 +1865,9 @@ void fnPropsAuxAtmEsc(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update,
ATOMMASS * num / den +
(KBOLTZ * body[iBody].dFlowTemp * body[iBody].dFHRef) /
((1 + XO * (QOH - 1)) * BDIFF * g);
- if (body[iBody].dCrossoverMass != ATOMMASS) {
+ if (!fbFloatComparison(body[iBody].dCrossoverMass,ATOMMASS)) {
rat = (body[iBody].dCrossoverMass / ATOMMASS - QOH) /
(body[iBody].dCrossoverMass / ATOMMASS - 1.);
- FH = body[iBody].dFHRef * pow(1. + (XO / (1. - XO)) * QOH * rat, -1);
body[iBody].dOxygenEta = 2 * XO / (1. - XO) * rat;
} else {
body[iBody].dOxygenEta = 0;
@@ -1882,7 +1878,6 @@ void fnPropsAuxAtmEsc(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update,
// Use below for LBEXACT equations with schaeffer diff lim
double x = (QOH - 1.) * (1. - XO) * (BDIFF * g * ATOMMASS) /
(KBOLTZ * body[iBody].dFlowTemp);
- double FH;
double rat;
// Get the crossover mass
@@ -1917,10 +1912,8 @@ void fnPropsAuxAtmEsc(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update,
(body[iBody].dFXUV >= FXUVCritDrag)) {
rat = (body[iBody].dCrossoverMass / ATOMMASS - QOH) /
(body[iBody].dCrossoverMass / ATOMMASS - 1.);
- FH = body[iBody].dFHRef * pow(1. + (XO / (1. - XO)) * QOH * rat, -1);
body[iBody].dOxygenEta = 2 * XO / (1. - XO) * rat;
} else {
- FH = body[iBody].dFHRef;
rat = ((body[iBody].dCrossoverMass / ATOMMASS) - QOH) /
((body[iBody].dCrossoverMass / ATOMMASS) - 1.);
body[iBody].dOxygenEta = 0;
@@ -2839,7 +2832,7 @@ void WriteRGLimit(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system,
double flux = fdHZRG14(body, iBody);
// Convert to semi-major axis *at current eccentricity!*
- if (body[0].dLuminosity == 0) {
+ if (fbFloatComparison(body[0].dLuminosity,0)) {
*dTmp = -1;
} else {
*dTmp = pow(4 * PI * flux /
@@ -3445,12 +3438,12 @@ void WriteHRefODragMod(BODY *body, CONTROL *control, OUTPUT *output,
SYSTEM *system, UNITS *units, UPDATE *update, int iBody,
double *dTmp, char **cUnit) {
// XXX This should probably all just be moved into a function
- if (body[iBody].dCrossoverMass / ATOMMASS - 1. != 0) {
+ if (!fbFloatComparison((body[iBody].dCrossoverMass / ATOMMASS), 1)) {
double rat = (body[iBody].dCrossoverMass / ATOMMASS - QOH) /
(body[iBody].dCrossoverMass / ATOMMASS - 1.);
double XO = fdAtomicOxygenMixingRatio(body[iBody].dSurfaceWaterMass,
body[iBody].dOxygenMass);
- if (XO == 1) {
+ if (fbFloatComparison(XO,1)) {
*dTmp = 0;
} else {
*dTmp = pow(1. + (XO / (1. - XO)) * QOH * rat, -1);
@@ -4162,7 +4155,7 @@ int fbDoesWaterEscape(BODY *body, EVOLVE *evolve, IO *io, int iBody) {
// approximation for a binary is only valid if the two stars have
// similar spectral types, or if body zero dominates the flux.
double dInstellation = fdInstellation(body, iBody);
- if (dInstellation == -1 && body[iBody].bCalcFXUV == 0) {
+ if (fbFloatComparison(dInstellation,-1) && fbFloatComparison(body[iBody].bCalcFXUV,0)) {
// Constant XUV flux, so set water to escape
return 1;
} else {
@@ -4368,8 +4361,8 @@ void fvLinearFit(double *x, double *y, int iLen, double *daCoeffs) {
// from http://en.wikipedia.org/wiki/Simple_linear_regression
double num = 0, den = 0;
double xavg = 0, yavg = 0;
- double m, b;
int i;
+
for (i = 0; i < iLen; i++) {
xavg += x[i];
yavg += y[i];
diff --git a/src/evolve.c b/src/evolve.c
index d9ef4a245..832eb495c 100644
--- a/src/evolve.c
+++ b/src/evolve.c
@@ -307,9 +307,9 @@ double fdGetTimeStep(BODY *body, CONTROL *control, SYSTEM *system,
update[iBody].daDerivProc[iVar][iEqn] =
fnUpdate[iBody][iVar][iEqn](
body, system, update[iBody].iaBody[iVar][iEqn]);
- if (!bFloatComparison(update[iBody].daDerivProc[iVar][iEqn],
+ if (!fbFloatComparison(update[iBody].daDerivProc[iVar][iEqn],
0.0) &&
- !bFloatComparison(*(update[iBody].pdVar[iVar]), 0.0)) {
+ !fbFloatComparison(*(update[iBody].pdVar[iVar]), 0.0)) {
dMinNow = fabs((*(update[iBody].pdVar[iVar])) /
update[iBody].daDerivProc[iVar][iEqn]);
if (dMinNow < dMin) {
diff --git a/src/options.c b/src/options.c
index f75117769..29dc6bc3e 100644
--- a/src/options.c
+++ b/src/options.c
@@ -343,7 +343,13 @@ void AddOptionDouble(char *cFile, char *cOption, double *dInput, int *iLine,
GetLine(cFile, cOption, &cLine, iLine, iVerbose);
if (*iLine >= 0) {
- sscanf(cLine, "%s %lf", cTmp, dInput);
+ int iNumOptionsRead = sscanf(cLine, "%s %lf", cTmp, dInput);
+ if (iNumOptionsRead != 2) {
+ printf("ERROR: %d arguments read for option %s.\n", iNumOptionsRead,
+ cOption);
+ printf("\tcLine=%s, cTmp=%s, dInput=%lf\n", cLine, cTmp, *dInput);
+ exit(EXIT_INPUT);
+ }
}
free(cLine);
}
@@ -354,7 +360,13 @@ void AddOptionInt(char *cFile, char *cOption, int *iInput, int *iLine,
GetLine(cFile, cOption, &cLine, iLine, iVerbose);
if (*iLine >= 0) {
- sscanf(cLine, "%s %d", cTmp, iInput);
+ int iNumOptionsRead = sscanf(cLine, "%s %d", cTmp, iInput);
+ if (iNumOptionsRead != 2) {
+ printf("ERROR: %d arguments read for option %s.\n", iNumOptionsRead,
+ cOption);
+ printf("\tcLine=%s, cTmp=%s, dInput=%d\n", cLine, cTmp, *iInput);
+ exit(EXIT_INPUT);
+ }
}
free(cLine);
}
@@ -384,7 +396,13 @@ void AddOptionString(char *cFile, char *cOption, char cInput[], int *iLine,
GetLine(cFile, cOption, &cLine, iLine, iVerbose);
if (*iLine >= 0) {
- sscanf(cLine, "%s %s", cTmp, cInput);
+ int iNumOptionsRead = sscanf(cLine, "%s %s", cTmp, cInput);
+ if (iNumOptionsRead != 2) {
+ printf("ERROR: %d arguments read for option %s.\n", iNumOptionsRead,
+ cOption);
+ printf("\tcLine=%s, cTmp=%s, dInput=%s\n", cLine, cTmp, cInput);
+ exit(EXIT_INPUT);
+ }
}
free(cLine);
}
diff --git a/src/output.c b/src/output.c
index 3ff27a9f1..846d5a821 100644
--- a/src/output.c
+++ b/src/output.c
@@ -2062,6 +2062,7 @@ void LogOutputOrder(BODY *body, CONTROL *control, FILES *files, OUTPUT *output,
}
fprintf(fp, "\n");
free(cCol);
+ free(cUnit);
}
void LogGridOutput(BODY *body, CONTROL *control, FILES *files, OUTPUT *output,
@@ -2190,7 +2191,6 @@ void LogBody(BODY *body, CONTROL *control, FILES *files, MODULE *module,
void WriteLog(BODY *body, CONTROL *control, FILES *files, MODULE *module,
OPTIONS *options, OUTPUT *output, SYSTEM *system, UPDATE *update,
fnUpdateVariable ***fnUpdate, fnWriteOutput fnWrite[], int iEnd) {
- char *cTime = NULL;
FILE *fp;
double dTotTime;
@@ -2202,13 +2202,10 @@ void WriteLog(BODY *body, CONTROL *control, FILES *files, MODULE *module,
double dDt = fdGetTimeStep(body, control, system, update, fnUpdate);
if (iEnd == 0) {
- fvFormattedString(&cTime, "Input");
fp = fopen(files->cLog, "w");
} else if (iEnd == 1) {
- fvFormattedString(&cTime, "Final");
fp = fopen(files->cLog, "a");
} else if (iEnd == -1) {
- fvFormattedString(&cTime, "Initial");
fp = fopen(files->cLog, "w");
} else {
fprintf(stderr, "ERROR: Unknown cTime in output.c:WriteLog.\n");
diff --git a/src/verify.c b/src/verify.c
index c0ec8eb4e..d480dbb1d 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -12,7 +12,7 @@
*/
/*! Check to see if two decimals numbers are equal (1) or not (0) */
-int bFloatComparison(double x, double y) {
+int fbFloatComparison(double x, double y) {
double dBigger;
double dRel_Tol;
if (fabs(x) > fabs(y)) {
diff --git a/src/verify.h b/src/verify.h
index 585b3bfbc..c96654114 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -13,7 +13,7 @@ void VerifyTripleExit(char[], char[], char[], int, int, int, char[], int);
void VerifyOptions(BODY *, CONTROL *, FILES *, MODULE *, OPTIONS *, OUTPUT *,
SYSTEM *, UPDATE *, fnIntegrate *, fnUpdateVariable ****);
void VerifyDynEllip(BODY *, CONTROL *, OPTIONS *, char[], int, int);
-int bFloatComparison(double, double);
+int fbFloatComparison(double, double);
void fnNullDerivatives(BODY *, EVOLVE *, MODULE *, UPDATE *,
fnUpdateVariable ***);
diff --git a/tests/Atmesc/HydELimConstXUVLopez12/planet.in b/tests/Atmesc/HydELimConstXUVLopez12/planet.in
index 31f79211b..eb9d4f8d9 100644
--- a/tests/Atmesc/HydELimConstXUVLopez12/planet.in
+++ b/tests/Atmesc/HydELimConstXUVLopez12/planet.in
@@ -8,7 +8,7 @@ dRadGyra 0.4 # Radius of gyration; ang. mom. coeff.
dAge 1.0e6 # Age [yr]
# ATMESC Parameters
-dFXUV -100 # Incident XUV flux (constant)
+dFXUV -100 # Incident XUV flux (constant)
dXFrac 1.0 # X-Ray/XUV absorption radius in planet radii
dAtmXAbsEffH 0.1 # H X-ray/XUV absorption efficiency (epsilon)
dSurfWaterMass 0.0 # Initial water mass, negative -> Earth oceans
diff --git a/tests/conftest.py b/tests/conftest.py
index 6878c35b3..93b905394 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -3,8 +3,6 @@
import shutil
import subprocess as subp
import sys
-
-import numpy as np
import pytest
import vplanet