Skip to content

Commit

Permalink
Run pre-commit (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
amarcozzi committed Oct 18, 2023
1 parent 6d5a61b commit 6771052
Show file tree
Hide file tree
Showing 54 changed files with 93 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
twine upload dist/*
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 2 additions & 5 deletions quicfire_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -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"]
49 changes: 25 additions & 24 deletions quicfire_tools/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/IgnitionType.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@
"can_be_modified": "Y"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@
"units": "[m]",
"can_be_modified": "Y"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@
"can_be_modified": "N",
"recommended_value": "0.1 m"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@
"units": "[-]",
"can_be_modified": "Y"
}
}
}
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/QP_buildout.inp.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"description": "total number of vegitative canopies",
"can_be_modified": "N"
}
}
}
3 changes: 1 addition & 2 deletions quicfire_tools/inputs/documentation/QUIC_fire.inp.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -275,4 +275,3 @@
"can_be_modified": "Y"
}
}

2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/QU_Simparams.inp.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@
"units": "[-]",
"recommended_value": "0"
}
}
}
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/QU_TopoInputs.inp.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
"recommended_value": "0.9-1.3 for real topo",
"can_be_modified": "Y"
}
}
}
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/QU_buildings.inp.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"can_be_modified": "N",
"recommended_value": "0"
}
}
}
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/QU_metparams.inp.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"units": "[-]",
"can_be_modified": "N"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"description": "Moving coordinates flag (0=no, 1=yes)",
"can_be_modified": "N"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"description": "Use Adaptive Computation Window (0=Disabled 1=Enabled)",
"can_be_modified": "Y"
}
}
}
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/TopoType.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,4 @@
"can_be_modified": "Y"
}
}
}
}
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/gridlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
"description": "Stretching factor for the vertical grid spacing",
"units": "[-]"
}
}
}
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/rasterorigin.txt.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"units": "[m]",
"variable_name_fortran": "ft%utmy"
}
}
}
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/documentation/sensor1.inp.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"units": "[degree]",
"can_be_modified": "Y"
}
}
}
1 change: 0 additions & 1 deletion quicfire_tools/inputs/templates/latest/QFire_Pyvista.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions quicfire_tools/inputs/templates/latest/QUIC_fire.inp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes)
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/latest/QU_fileoptions.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
0 !flag to generate startup files (0 = no, 1 = yes)
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/latest/QU_metparams.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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
$sensor_lines
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/latest/rasterorigin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ $utm_y
3752846.04249607
742265.868913356
3742846.04249607
10000
10000
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/latest/sensor1.inp
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
0.03 ! m, fb thickness
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.1.1/QUIC_fire.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes)
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.1.1/QU_fileoptions.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
0 !flag to generate startup files (0 = no, 1 = yes)
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.1.1/QU_metparams.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$num_cpus ! max number of cpu
$num_cpus ! max number of cpu
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.1.1/gridlist
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@
nonos=1 nfct=1 nonosold=1
inonlocal=0 isubgridgas=0
!st=1.0e-05
/
/
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.1.1/rasterorigin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
3752846.04249607
742265.868913356
3742846.04249607
10000
10000
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.1.1/sensor1.inp
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 0 additions & 1 deletion quicfire_tools/inputs/templates/v5.2.3/QFire_Pyvista.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions quicfire_tools/inputs/templates/v5.2.3/QUIC_fire.inp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
$auto_kill ! Kill if the fire is out and there are no more ignitions or firebrands (0 = no, 1 = yes)
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.2.3/QU_fileoptions.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
0 !flag to generate startup files (0 = no, 1 = yes)
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.2.3/QU_metparams.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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
$sensor_lines
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.2.3/gridlist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
n=$nx
m=$ny
m=$ny
l=$nz
aa1=$dz
nv=8
Expand Down
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.2.3/rasterorigin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
3752846.04249607
742265.868913356
3742846.04249607
10000
10000
2 changes: 1 addition & 1 deletion quicfire_tools/inputs/templates/v5.2.3/sensor1.inp
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Loading

0 comments on commit 6771052

Please sign in to comment.