From 6771052dd5a693eaa25cd321a0fbb3b8f81c581c Mon Sep 17 00:00:00 2001 From: Anthony Marcozzi Date: Wed, 18 Oct 2023 16:41:57 -0600 Subject: [PATCH] Run pre-commit (#51) --- .github/workflows/release.yml | 2 +- .pre-commit-config.yaml | 2 - quicfire_tools/__init__.py | 7 +-- quicfire_tools/inputs.py | 49 ++++++++++--------- .../inputs/documentation/IgnitionType.json | 2 +- .../QFire_Advanced_User_Inputs.inp.json | 2 +- .../QFire_Bldg_Advanced_User_Inputs.inp.json | 2 +- .../QFire_Plume_Advanced_User_Inputs.inp.json | 2 +- .../inputs/documentation/QP_buildout.inp.json | 2 +- .../inputs/documentation/QUIC_fire.inp.json | 3 +- .../documentation/QU_Simparams.inp.json | 2 +- .../documentation/QU_TopoInputs.inp.json | 2 +- .../documentation/QU_buildings.inp.json | 2 +- .../documentation/QU_metparams.inp.json | 2 +- .../documentation/QU_movingcoords.inp.json | 2 +- .../Runtime_Advanced_User_Inputs.inp.json | 2 +- .../inputs/documentation/TopoType.json | 2 +- .../inputs/documentation/gridlist.json | 2 +- .../documentation/rasterorigin.txt.json | 2 +- .../inputs/documentation/sensor1.inp.json | 2 +- .../inputs/templates/latest/QFire_Pyvista.inp | 1 - .../inputs/templates/latest/QUIC_fire.inp | 4 +- .../templates/latest/QU_fileoptions.inp | 2 +- .../inputs/templates/latest/QU_metparams.inp | 2 +- .../inputs/templates/latest/rasterorigin.txt | 2 +- .../inputs/templates/latest/sensor1.inp | 2 +- .../v5.1.1/QFire_Advanced_User_Inputs.inp | 2 +- .../QFire_Plume_Advanced_User_Inputs.inp | 2 +- .../inputs/templates/v5.1.1/QUIC_fire.inp | 2 +- .../templates/v5.1.1/QU_fileoptions.inp | 2 +- .../inputs/templates/v5.1.1/QU_metparams.inp | 2 +- .../v5.1.1/Runtime_Advanced_User_Inputs.inp | 2 +- .../inputs/templates/v5.1.1/gridlist | 2 +- .../inputs/templates/v5.1.1/rasterorigin.txt | 2 +- .../inputs/templates/v5.1.1/sensor1.inp | 2 +- .../QFire_Plume_Advanced_User_Inputs.inp | 2 +- .../inputs/templates/v5.2.3/QFire_Pyvista.inp | 1 - .../inputs/templates/v5.2.3/QUIC_fire.inp | 4 +- .../templates/v5.2.3/QU_fileoptions.inp | 2 +- .../inputs/templates/v5.2.3/QU_metparams.inp | 2 +- .../inputs/templates/v5.2.3/gridlist | 2 +- .../inputs/templates/v5.2.3/rasterorigin.txt | 2 +- .../inputs/templates/v5.2.3/sensor1.inp | 2 +- quicfire_tools/outputs.py | 3 +- quicfire_tools/topography.py | 3 +- requirements/docs.txt | 2 +- requirements/readme.md | 1 - requirements/requirements.yml | 2 +- requirements/tests-310.yml | 2 +- requirements/tests-311.yml | 2 +- requirements/tests-38.yml | 2 +- requirements/tests-39.yml | 2 +- setup.py | 29 +++++------ tests/__init__.py | 1 + 54 files changed, 93 insertions(+), 97 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da51b6d..3eb9745 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,4 +29,4 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | python setup.py sdist bdist_wheel - twine upload dist/* \ No newline at end of file + twine upload dist/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e824fa..01e58d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,9 +14,7 @@ repos: rev: 23.1.0 hooks: - id: black - language_version: python3.10 - id: black-jupyter - language_version: python3.10 - repo: https://github.com/PyCQA/flake8 rev: 6.0.0 hooks: diff --git a/quicfire_tools/__init__.py b/quicfire_tools/__init__.py index 8bf1133..027f0cc 100644 --- a/quicfire_tools/__init__.py +++ b/quicfire_tools/__init__.py @@ -1,7 +1,4 @@ -from quicfire_tools.outputs import SimulationOutputs, OutputFile +from quicfire_tools.outputs import OutputFile, SimulationOutputs from quicfire_tools.parameters import SimulationParameters - -__all__ = ['SimulationParameters', - 'SimulationOutputs', - 'OutputFile'] +__all__ = ["SimulationParameters", "SimulationOutputs", "OutputFile"] diff --git a/quicfire_tools/inputs.py b/quicfire_tools/inputs.py index d7e5dfd..cad5e02 100644 --- a/quicfire_tools/inputs.py +++ b/quicfire_tools/inputs.py @@ -3,48 +3,49 @@ """ from __future__ import annotations -# Internal Imports -from quicfire_tools.utils import compute_parabolic_stretched_grid - -from quicfire_tools.topography import ( - TopoType, - GaussianHillTopo, - HillPassTopo, - SlopeMesaTopo, - CanyonTopo, - HalfCircleTopo, - SinusoidTopo, - CosHillTopo, -) -from quicfire_tools.ignitions import ( - IgnitionType, - RectangleIgnition, - SquareRingIgnition, - CircularRingIgnition, -) +import importlib.resources # Core Imports import json import time -import importlib.resources from pathlib import Path -from typing import Literal from string import Template +from typing import Literal # External Imports import numpy as np from pydantic import ( BaseModel, Field, + NonNegativeFloat, NonNegativeInt, - PositiveInt, PositiveFloat, - NonNegativeFloat, + PositiveInt, + SerializeAsAny, computed_field, field_validator, - SerializeAsAny, ) +from quicfire_tools.ignitions import ( + CircularRingIgnition, + IgnitionType, + RectangleIgnition, + SquareRingIgnition, +) +from quicfire_tools.topography import ( + CanyonTopo, + CosHillTopo, + GaussianHillTopo, + HalfCircleTopo, + HillPassTopo, + SinusoidTopo, + SlopeMesaTopo, + TopoType, +) + +# Internal Imports +from quicfire_tools.utils import compute_parabolic_stretched_grid + DOCS_PATH = ( importlib.resources.files("quicfire_tools") .joinpath("inputs") diff --git a/quicfire_tools/inputs/documentation/IgnitionType.json b/quicfire_tools/inputs/documentation/IgnitionType.json index bd2d9e3..6d29398 100644 --- a/quicfire_tools/inputs/documentation/IgnitionType.json +++ b/quicfire_tools/inputs/documentation/IgnitionType.json @@ -110,4 +110,4 @@ "can_be_modified": "Y" } } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QFire_Advanced_User_Inputs.inp.json b/quicfire_tools/inputs/documentation/QFire_Advanced_User_Inputs.inp.json index 6a5940b..63c5b11 100644 --- a/quicfire_tools/inputs/documentation/QFire_Advanced_User_Inputs.inp.json +++ b/quicfire_tools/inputs/documentation/QFire_Advanced_User_Inputs.inp.json @@ -111,4 +111,4 @@ "units": "[m]", "can_be_modified": "Y" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QFire_Bldg_Advanced_User_Inputs.inp.json b/quicfire_tools/inputs/documentation/QFire_Bldg_Advanced_User_Inputs.inp.json index 9373934..d34fe4a 100644 --- a/quicfire_tools/inputs/documentation/QFire_Bldg_Advanced_User_Inputs.inp.json +++ b/quicfire_tools/inputs/documentation/QFire_Bldg_Advanced_User_Inputs.inp.json @@ -71,4 +71,4 @@ "can_be_modified": "N", "recommended_value": "0.1 m" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QFire_Plume_Advanced_User_Inputs.inp.json b/quicfire_tools/inputs/documentation/QFire_Plume_Advanced_User_Inputs.inp.json index 5f02f63..abc1b39 100644 --- a/quicfire_tools/inputs/documentation/QFire_Plume_Advanced_User_Inputs.inp.json +++ b/quicfire_tools/inputs/documentation/QFire_Plume_Advanced_User_Inputs.inp.json @@ -129,4 +129,4 @@ "units": "[-]", "can_be_modified": "Y" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QP_buildout.inp.json b/quicfire_tools/inputs/documentation/QP_buildout.inp.json index 7cd7004..97908d8 100644 --- a/quicfire_tools/inputs/documentation/QP_buildout.inp.json +++ b/quicfire_tools/inputs/documentation/QP_buildout.inp.json @@ -9,4 +9,4 @@ "description": "total number of vegitative canopies", "can_be_modified": "N" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QUIC_fire.inp.json b/quicfire_tools/inputs/documentation/QUIC_fire.inp.json index 932fe3d..714cf9f 100644 --- a/quicfire_tools/inputs/documentation/QUIC_fire.inp.json +++ b/quicfire_tools/inputs/documentation/QUIC_fire.inp.json @@ -259,7 +259,7 @@ "can_be_modified": "Y", "recommended_value": "0" }, - "intensity_out": { + "intensity_out": { "values_accepted": "[0 1]", "tested_values_range": "0, 1", "description": "Flag to output (1) or not (0) surface fire intensity at every fire time step", @@ -275,4 +275,3 @@ "can_be_modified": "Y" } } - \ No newline at end of file diff --git a/quicfire_tools/inputs/documentation/QU_Simparams.inp.json b/quicfire_tools/inputs/documentation/QU_Simparams.inp.json index 424cb4e..72f0ed0 100644 --- a/quicfire_tools/inputs/documentation/QU_Simparams.inp.json +++ b/quicfire_tools/inputs/documentation/QU_Simparams.inp.json @@ -172,4 +172,4 @@ "units": "[-]", "recommended_value": "0" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QU_TopoInputs.inp.json b/quicfire_tools/inputs/documentation/QU_TopoInputs.inp.json index c048aa6..30ab09a 100644 --- a/quicfire_tools/inputs/documentation/QU_TopoInputs.inp.json +++ b/quicfire_tools/inputs/documentation/QU_TopoInputs.inp.json @@ -52,4 +52,4 @@ "recommended_value": "0.9-1.3 for real topo", "can_be_modified": "Y" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QU_buildings.inp.json b/quicfire_tools/inputs/documentation/QU_buildings.inp.json index 77a102f..13e959b 100644 --- a/quicfire_tools/inputs/documentation/QU_buildings.inp.json +++ b/quicfire_tools/inputs/documentation/QU_buildings.inp.json @@ -22,4 +22,4 @@ "can_be_modified": "N", "recommended_value": "0" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QU_metparams.inp.json b/quicfire_tools/inputs/documentation/QU_metparams.inp.json index 841cc34..33280a5 100644 --- a/quicfire_tools/inputs/documentation/QU_metparams.inp.json +++ b/quicfire_tools/inputs/documentation/QU_metparams.inp.json @@ -13,4 +13,4 @@ "units": "[-]", "can_be_modified": "N" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/QU_movingcoords.inp.json b/quicfire_tools/inputs/documentation/QU_movingcoords.inp.json index f636fd5..432be37 100644 --- a/quicfire_tools/inputs/documentation/QU_movingcoords.inp.json +++ b/quicfire_tools/inputs/documentation/QU_movingcoords.inp.json @@ -4,4 +4,4 @@ "description": "Moving coordinates flag (0=no, 1=yes)", "can_be_modified": "N" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/Runtime_Advanced_User_Inputs.inp.json b/quicfire_tools/inputs/documentation/Runtime_Advanced_User_Inputs.inp.json index a22484f..5459233 100644 --- a/quicfire_tools/inputs/documentation/Runtime_Advanced_User_Inputs.inp.json +++ b/quicfire_tools/inputs/documentation/Runtime_Advanced_User_Inputs.inp.json @@ -14,4 +14,4 @@ "description": "Use Adaptive Computation Window (0=Disabled 1=Enabled)", "can_be_modified": "Y" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/TopoType.json b/quicfire_tools/inputs/documentation/TopoType.json index 4b1d0c5..cdf912f 100644 --- a/quicfire_tools/inputs/documentation/TopoType.json +++ b/quicfire_tools/inputs/documentation/TopoType.json @@ -160,4 +160,4 @@ "can_be_modified": "Y" } } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/gridlist.json b/quicfire_tools/inputs/documentation/gridlist.json index ef4e357..68a9c78 100644 --- a/quicfire_tools/inputs/documentation/gridlist.json +++ b/quicfire_tools/inputs/documentation/gridlist.json @@ -43,4 +43,4 @@ "description": "Stretching factor for the vertical grid spacing", "units": "[-]" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/rasterorigin.txt.json b/quicfire_tools/inputs/documentation/rasterorigin.txt.json index 53a0f9e..6e441d3 100644 --- a/quicfire_tools/inputs/documentation/rasterorigin.txt.json +++ b/quicfire_tools/inputs/documentation/rasterorigin.txt.json @@ -14,4 +14,4 @@ "units": "[m]", "variable_name_fortran": "ft%utmy" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/documentation/sensor1.inp.json b/quicfire_tools/inputs/documentation/sensor1.inp.json index 2457b24..e07423a 100644 --- a/quicfire_tools/inputs/documentation/sensor1.inp.json +++ b/quicfire_tools/inputs/documentation/sensor1.inp.json @@ -31,4 +31,4 @@ "units": "[degree]", "can_be_modified": "Y" } -} \ No newline at end of file +} diff --git a/quicfire_tools/inputs/templates/latest/QFire_Pyvista.inp b/quicfire_tools/inputs/templates/latest/QFire_Pyvista.inp index d2a32d6..af7515e 100644 --- a/quicfire_tools/inputs/templates/latest/QFire_Pyvista.inp +++ b/quicfire_tools/inputs/templates/latest/QFire_Pyvista.inp @@ -25,4 +25,3 @@ camOrbit=0 windBarNormalized=none windBarBounds=[-10.0,10.0] compile=0 run=1 compiler='gfortran' compiler_mode='release' testcase='LineFire' ./adv_compile_and_run.sh - diff --git a/quicfire_tools/inputs/templates/latest/QUIC_fire.inp b/quicfire_tools/inputs/templates/latest/QUIC_fire.inp index a47d07c..552fa12 100644 --- a/quicfire_tools/inputs/templates/latest/QUIC_fire.inp +++ b/quicfire_tools/inputs/templates/latest/QUIC_fire.inp @@ -1,4 +1,4 @@ -$fire_flag ! Fire flag: 1 = run fire; 0 = no fire +$fire_flag ! Fire flag: 1 = run fire; 0 = no fire $random_seed ! Random number generator: -1: use time and date, any other integer > 0 is used as the seed ! FIRE TIMES $time_now ! When the fire is ignited in Unix Epoch time (integer seconds since 1970/1/1 00:00:00). Must be greater or equal to the time of the first wind @@ -39,4 +39,4 @@ $emissions_out ! Output compressed array emissions (fire grid) $radiation_out ! Output gridded thermal radiation (fire grid) $intensity_out ! Output surface fire intensity at every fire time step ! AUTOKILL -$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes) \ No newline at end of file +$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes) diff --git a/quicfire_tools/inputs/templates/latest/QU_fileoptions.inp b/quicfire_tools/inputs/templates/latest/QU_fileoptions.inp index 9eeefa0..605458f 100755 --- a/quicfire_tools/inputs/templates/latest/QU_fileoptions.inp +++ b/quicfire_tools/inputs/templates/latest/QU_fileoptions.inp @@ -3,4 +3,4 @@ 0 !flag to write out non-mass conserved initial field (uofield.dat) (1=write,0=no write) 0 !flag to write out the file uosensorfield.dat, the initial sensor velocity field (1=write,0=no write) 0 !flag to write out the file QU_staggered_velocity.bin used by QUIC-Pressure(1=write,0=no write) -0 !flag to generate startup files (0 = no, 1 = yes) \ No newline at end of file +0 !flag to generate startup files (0 = no, 1 = yes) diff --git a/quicfire_tools/inputs/templates/latest/QU_metparams.inp b/quicfire_tools/inputs/templates/latest/QU_metparams.inp index bc7a779..3f801e8 100644 --- a/quicfire_tools/inputs/templates/latest/QU_metparams.inp +++ b/quicfire_tools/inputs/templates/latest/QU_metparams.inp @@ -2,4 +2,4 @@ 0 !Met input flag (0=QUIC,1=WRF,2=ITT MM5,3=HOTMAC) $num_sensors !Number of measuring sites 1 !Maximum size of data points profiles -$sensor_lines \ No newline at end of file +$sensor_lines diff --git a/quicfire_tools/inputs/templates/latest/rasterorigin.txt b/quicfire_tools/inputs/templates/latest/rasterorigin.txt index 82d4bdd..0cd1bf6 100644 --- a/quicfire_tools/inputs/templates/latest/rasterorigin.txt +++ b/quicfire_tools/inputs/templates/latest/rasterorigin.txt @@ -4,4 +4,4 @@ $utm_y 3752846.04249607 742265.868913356 3742846.04249607 -10000 \ No newline at end of file +10000 diff --git a/quicfire_tools/inputs/templates/latest/sensor1.inp b/quicfire_tools/inputs/templates/latest/sensor1.inp index 2d6af0c..82c0949 100644 --- a/quicfire_tools/inputs/templates/latest/sensor1.inp +++ b/quicfire_tools/inputs/templates/latest/sensor1.inp @@ -1,4 +1,4 @@ -sensor1 !Site Name +sensor1 !Site Name 0 !Upper level flag (1 = use this profile for upper level winds) 50 !Upper level height (meters) 1 !Site Coordinate Flag (1=QUIC, 2=UTM, 3=Lat/Lon) diff --git a/quicfire_tools/inputs/templates/v5.1.1/QFire_Advanced_User_Inputs.inp b/quicfire_tools/inputs/templates/v5.1.1/QFire_Advanced_User_Inputs.inp index 9485541..6c70b36 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/QFire_Advanced_User_Inputs.inp +++ b/quicfire_tools/inputs/templates/v5.1.1/QFire_Advanced_User_Inputs.inp @@ -11,4 +11,4 @@ 50 ! N/A, minimum number of ignitions via firebrands at a point 100 ! N/A, maximum number of ignitions via firebrands at a point 0.523598 ! rad, min_theta_value (pi/6) -0.03 ! m, fb thickness \ No newline at end of file +0.03 ! m, fb thickness diff --git a/quicfire_tools/inputs/templates/v5.1.1/QFire_Plume_Advanced_User_Inputs.inp b/quicfire_tools/inputs/templates/v5.1.1/QFire_Plume_Advanced_User_Inputs.inp index 67b317e..b0b462e 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/QFire_Plume_Advanced_User_Inputs.inp +++ b/quicfire_tools/inputs/templates/v5.1.1/QFire_Plume_Advanced_User_Inputs.inp @@ -10,7 +10,7 @@ 10 ! alpha 2 - plume centerline 2 ! alpha 2 - plume edges 30. ! deg, max angle between plumes to merging -0.7 ! N/A, fraction of overlap of plumes for merging +0.7 ! N/A, fraction of overlap of plumes for merging 1 ! N/A, which wplume-to-grid scheme: 0 = new, 1 = old 10 ! N/A, number of points per edge for new scheme (only new scheme) 1 ! N/A, w computation: 1 = max(w), 0 = sum(w^3) diff --git a/quicfire_tools/inputs/templates/v5.1.1/QUIC_fire.inp b/quicfire_tools/inputs/templates/v5.1.1/QUIC_fire.inp index 397a7a5..c8d6e63 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/QUIC_fire.inp +++ b/quicfire_tools/inputs/templates/v5.1.1/QUIC_fire.inp @@ -40,4 +40,4 @@ $ignition_flag ! 1 = rectangle, 2 = square ring, 3 = circular ring, 4 = fil 0 ! Output gridded thermal radiation (fire grid) 0 ! Output surface fire intensity at every fire time step ! AUTOKILL -$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes) \ No newline at end of file +$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes) diff --git a/quicfire_tools/inputs/templates/v5.1.1/QU_fileoptions.inp b/quicfire_tools/inputs/templates/v5.1.1/QU_fileoptions.inp index 9eeefa0..605458f 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/QU_fileoptions.inp +++ b/quicfire_tools/inputs/templates/v5.1.1/QU_fileoptions.inp @@ -3,4 +3,4 @@ 0 !flag to write out non-mass conserved initial field (uofield.dat) (1=write,0=no write) 0 !flag to write out the file uosensorfield.dat, the initial sensor velocity field (1=write,0=no write) 0 !flag to write out the file QU_staggered_velocity.bin used by QUIC-Pressure(1=write,0=no write) -0 !flag to generate startup files (0 = no, 1 = yes) \ No newline at end of file +0 !flag to generate startup files (0 = no, 1 = yes) diff --git a/quicfire_tools/inputs/templates/v5.1.1/QU_metparams.inp b/quicfire_tools/inputs/templates/v5.1.1/QU_metparams.inp index a41fb25..988c4ef 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/QU_metparams.inp +++ b/quicfire_tools/inputs/templates/v5.1.1/QU_metparams.inp @@ -2,6 +2,6 @@ 0 !Met input flag (0=QUIC,1=WRF,2=ITT MM5,3=HOTMAC) 1 !Number of measuring sites 1 !Maximum size of data points profiles -sensor1 !Site Name +sensor1 !Site Name !File name sensor1.inp diff --git a/quicfire_tools/inputs/templates/v5.1.1/Runtime_Advanced_User_Inputs.inp b/quicfire_tools/inputs/templates/v5.1.1/Runtime_Advanced_User_Inputs.inp index be86501..980f37f 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/Runtime_Advanced_User_Inputs.inp +++ b/quicfire_tools/inputs/templates/v5.1.1/Runtime_Advanced_User_Inputs.inp @@ -1 +1 @@ -$num_cpus ! max number of cpu \ No newline at end of file +$num_cpus ! max number of cpu diff --git a/quicfire_tools/inputs/templates/v5.1.1/gridlist b/quicfire_tools/inputs/templates/v5.1.1/gridlist index dfa168f..a55adba 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/gridlist +++ b/quicfire_tools/inputs/templates/v5.1.1/gridlist @@ -92,4 +92,4 @@ nonos=1 nfct=1 nonosold=1 inonlocal=0 isubgridgas=0 !st=1.0e-05 -/ \ No newline at end of file +/ diff --git a/quicfire_tools/inputs/templates/v5.1.1/rasterorigin.txt b/quicfire_tools/inputs/templates/v5.1.1/rasterorigin.txt index b0916ba..3549dca 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/rasterorigin.txt +++ b/quicfire_tools/inputs/templates/v5.1.1/rasterorigin.txt @@ -4,4 +4,4 @@ 3752846.04249607 742265.868913356 3742846.04249607 -10000 \ No newline at end of file +10000 diff --git a/quicfire_tools/inputs/templates/v5.1.1/sensor1.inp b/quicfire_tools/inputs/templates/v5.1.1/sensor1.inp index 3713549..7d72798 100644 --- a/quicfire_tools/inputs/templates/v5.1.1/sensor1.inp +++ b/quicfire_tools/inputs/templates/v5.1.1/sensor1.inp @@ -1,4 +1,4 @@ -sensor1 !Site Name +sensor1 !Site Name 0 !Upper level flag (1 = use this profile for upper level winds) 50 !Upper level height (meters) 1 !Site Coordinate Flag (1=QUIC, 2=UTM, 3=Lat/Lon) diff --git a/quicfire_tools/inputs/templates/v5.2.3/QFire_Plume_Advanced_User_Inputs.inp b/quicfire_tools/inputs/templates/v5.2.3/QFire_Plume_Advanced_User_Inputs.inp index 67b317e..b0b462e 100755 --- a/quicfire_tools/inputs/templates/v5.2.3/QFire_Plume_Advanced_User_Inputs.inp +++ b/quicfire_tools/inputs/templates/v5.2.3/QFire_Plume_Advanced_User_Inputs.inp @@ -10,7 +10,7 @@ 10 ! alpha 2 - plume centerline 2 ! alpha 2 - plume edges 30. ! deg, max angle between plumes to merging -0.7 ! N/A, fraction of overlap of plumes for merging +0.7 ! N/A, fraction of overlap of plumes for merging 1 ! N/A, which wplume-to-grid scheme: 0 = new, 1 = old 10 ! N/A, number of points per edge for new scheme (only new scheme) 1 ! N/A, w computation: 1 = max(w), 0 = sum(w^3) diff --git a/quicfire_tools/inputs/templates/v5.2.3/QFire_Pyvista.inp b/quicfire_tools/inputs/templates/v5.2.3/QFire_Pyvista.inp index d2a32d6..af7515e 100644 --- a/quicfire_tools/inputs/templates/v5.2.3/QFire_Pyvista.inp +++ b/quicfire_tools/inputs/templates/v5.2.3/QFire_Pyvista.inp @@ -25,4 +25,3 @@ camOrbit=0 windBarNormalized=none windBarBounds=[-10.0,10.0] compile=0 run=1 compiler='gfortran' compiler_mode='release' testcase='LineFire' ./adv_compile_and_run.sh - diff --git a/quicfire_tools/inputs/templates/v5.2.3/QUIC_fire.inp b/quicfire_tools/inputs/templates/v5.2.3/QUIC_fire.inp index a47d07c..552fa12 100644 --- a/quicfire_tools/inputs/templates/v5.2.3/QUIC_fire.inp +++ b/quicfire_tools/inputs/templates/v5.2.3/QUIC_fire.inp @@ -1,4 +1,4 @@ -$fire_flag ! Fire flag: 1 = run fire; 0 = no fire +$fire_flag ! Fire flag: 1 = run fire; 0 = no fire $random_seed ! Random number generator: -1: use time and date, any other integer > 0 is used as the seed ! FIRE TIMES $time_now ! When the fire is ignited in Unix Epoch time (integer seconds since 1970/1/1 00:00:00). Must be greater or equal to the time of the first wind @@ -39,4 +39,4 @@ $emissions_out ! Output compressed array emissions (fire grid) $radiation_out ! Output gridded thermal radiation (fire grid) $intensity_out ! Output surface fire intensity at every fire time step ! AUTOKILL -$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes) \ No newline at end of file +$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes) diff --git a/quicfire_tools/inputs/templates/v5.2.3/QU_fileoptions.inp b/quicfire_tools/inputs/templates/v5.2.3/QU_fileoptions.inp index 9eeefa0..605458f 100755 --- a/quicfire_tools/inputs/templates/v5.2.3/QU_fileoptions.inp +++ b/quicfire_tools/inputs/templates/v5.2.3/QU_fileoptions.inp @@ -3,4 +3,4 @@ 0 !flag to write out non-mass conserved initial field (uofield.dat) (1=write,0=no write) 0 !flag to write out the file uosensorfield.dat, the initial sensor velocity field (1=write,0=no write) 0 !flag to write out the file QU_staggered_velocity.bin used by QUIC-Pressure(1=write,0=no write) -0 !flag to generate startup files (0 = no, 1 = yes) \ No newline at end of file +0 !flag to generate startup files (0 = no, 1 = yes) diff --git a/quicfire_tools/inputs/templates/v5.2.3/QU_metparams.inp b/quicfire_tools/inputs/templates/v5.2.3/QU_metparams.inp index bc7a779..3f801e8 100644 --- a/quicfire_tools/inputs/templates/v5.2.3/QU_metparams.inp +++ b/quicfire_tools/inputs/templates/v5.2.3/QU_metparams.inp @@ -2,4 +2,4 @@ 0 !Met input flag (0=QUIC,1=WRF,2=ITT MM5,3=HOTMAC) $num_sensors !Number of measuring sites 1 !Maximum size of data points profiles -$sensor_lines \ No newline at end of file +$sensor_lines diff --git a/quicfire_tools/inputs/templates/v5.2.3/gridlist b/quicfire_tools/inputs/templates/v5.2.3/gridlist index 4facaff..4c76e52 100644 --- a/quicfire_tools/inputs/templates/v5.2.3/gridlist +++ b/quicfire_tools/inputs/templates/v5.2.3/gridlist @@ -1,5 +1,5 @@ n=$nx -m=$ny +m=$ny l=$nz aa1=$dz nv=8 diff --git a/quicfire_tools/inputs/templates/v5.2.3/rasterorigin.txt b/quicfire_tools/inputs/templates/v5.2.3/rasterorigin.txt index b0916ba..3549dca 100644 --- a/quicfire_tools/inputs/templates/v5.2.3/rasterorigin.txt +++ b/quicfire_tools/inputs/templates/v5.2.3/rasterorigin.txt @@ -4,4 +4,4 @@ 3752846.04249607 742265.868913356 3742846.04249607 -10000 \ No newline at end of file +10000 diff --git a/quicfire_tools/inputs/templates/v5.2.3/sensor1.inp b/quicfire_tools/inputs/templates/v5.2.3/sensor1.inp index 2d6af0c..82c0949 100644 --- a/quicfire_tools/inputs/templates/v5.2.3/sensor1.inp +++ b/quicfire_tools/inputs/templates/v5.2.3/sensor1.inp @@ -1,4 +1,4 @@ -sensor1 !Site Name +sensor1 !Site Name 0 !Upper level flag (1 = use this profile for upper level winds) 50 !Upper level height (meters) 1 !Site Coordinate Flag (1=QUIC, 2=UTM, 3=Lat/Lon) diff --git a/quicfire_tools/outputs.py b/quicfire_tools/outputs.py index 0893a49..a7823d7 100644 --- a/quicfire_tools/outputs.py +++ b/quicfire_tools/outputs.py @@ -7,9 +7,10 @@ import re from pathlib import Path +import numpy as np + # External imports import zarr -import numpy as np from numpy import ndarray # Internal imports diff --git a/quicfire_tools/topography.py b/quicfire_tools/topography.py index 19fb1a7..3a547ea 100644 --- a/quicfire_tools/topography.py +++ b/quicfire_tools/topography.py @@ -8,7 +8,8 @@ # External Imports from typing import Literal -from pydantic import BaseModel, PositiveInt, PositiveFloat, Field, SerializeAsAny + +from pydantic import BaseModel, Field, PositiveFloat, PositiveInt, SerializeAsAny class TopoSources(int, Enum): diff --git a/requirements/docs.txt b/requirements/docs.txt index d27ee82..4a30805 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,2 +1,2 @@ mkdocstrings -mkdocstrings-python \ No newline at end of file +mkdocstrings-python diff --git a/requirements/readme.md b/requirements/readme.md index a6b833a..c08b860 100644 --- a/requirements/readme.md +++ b/requirements/readme.md @@ -16,4 +16,3 @@ Requirements for building documentation. Requirements for testing with different Python versions. Uses conda environment yaml files. - diff --git a/requirements/requirements.yml b/requirements/requirements.yml index cb4bb92..f2239f5 100644 --- a/requirements/requirements.yml +++ b/requirements/requirements.yml @@ -10,4 +10,4 @@ dependencies: - scipy - pandas - ca-certificates - - openssl \ No newline at end of file + - openssl diff --git a/requirements/tests-310.yml b/requirements/tests-310.yml index 6546ae3..dee4b7a 100644 --- a/requirements/tests-310.yml +++ b/requirements/tests-310.yml @@ -12,4 +12,4 @@ dependencies: - certifi - zarr - numpy - - scipy \ No newline at end of file + - scipy diff --git a/requirements/tests-311.yml b/requirements/tests-311.yml index b2e7696..dacad40 100644 --- a/requirements/tests-311.yml +++ b/requirements/tests-311.yml @@ -12,4 +12,4 @@ dependencies: - certifi - zarr - numpy - - scipy \ No newline at end of file + - scipy diff --git a/requirements/tests-38.yml b/requirements/tests-38.yml index 9813379..2878aff 100644 --- a/requirements/tests-38.yml +++ b/requirements/tests-38.yml @@ -12,4 +12,4 @@ dependencies: - certifi - zarr - numpy - - scipy \ No newline at end of file + - scipy diff --git a/requirements/tests-39.yml b/requirements/tests-39.yml index 9484f41..fd59c34 100644 --- a/requirements/tests-39.yml +++ b/requirements/tests-39.yml @@ -12,4 +12,4 @@ dependencies: - certifi - zarr - numpy - - scipy \ No newline at end of file + - scipy diff --git a/setup.py b/setup.py index ca92fa9..208a143 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ import os + import requests from setuptools import find_packages, setup @@ -23,9 +24,7 @@ def get_version(): VERSION = get_version() LICENSE = "MIT" URL = "https://github.com/silvxlabs/quicfire-tools" -PROJECT_URLS = { - "Bug Tracker": f"{URL}/issues" -} +PROJECT_URLS = {"Bug Tracker": f"{URL}/issues"} setup( name=NAME, @@ -36,20 +35,22 @@ def get_version(): license=LICENSE, url=URL, project_urls=PROJECT_URLS, - classifiers=["Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering", ], + classifiers=[ + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering", + ], package_dir={"": "."}, packages=find_packages(exclude=["docs", "tests"]), package_data={ - 'quicfire_tools': ['templates/*/*'], + "quicfire_tools": ["templates/*/*"], }, include_package_data=True, install_requires=[ diff --git a/tests/__init__.py b/tests/__init__.py index ac1471a..7dcdbfc 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -4,4 +4,5 @@ if TEST_ENV == "local": import sys + sys.path.append("../quicfire_tools")