Skip to content

Commit

Permalink
Fix trailing spaces found by style CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Oct 5, 2023
1 parent 053bf96 commit 23b5b36
Show file tree
Hide file tree
Showing 20 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/burn_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
value2=$(awk 'NR=='"$line_number"' {match($0, /[+-]?[0-9]+([.][0-9]+)?[eE]?[+-]?[0-9]+/); if (RSTART) print substr($0, RSTART, RLENGTH)}' reference_solution.out)
difference=$(awk -v val1="$value1" -v val2="$value2" 'BEGIN { printf "%.2f", (val1 - val2) / val2 }')
if (( $(echo "$difference > $threshold" | bc -l) )); then
echo "Line number: $line_number"
echo "Value in test.out: $value1"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '[0-9][0-9].[0-9][0-9]'
- '[0-9][0-9].[0-9][0-9]'

name: Create Release

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/find_changed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def find_files(SHAs=None):
if stderr is not None:
raise Exception('git diff encountered an error')

files = [f for f in stdout.decode('utf-8').strip().split('\n')
files = [f for f in stdout.decode('utf-8').strip().split('\n')
if f.startswith('networks/')]
print(files)

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/get_release_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
txt = txt[m.end():].strip()
else:
txt = ""
# we now need to substitute characters in the string so that
# the action can deal with line breaks

# we now need to substitute characters in the string so that
# the action can deal with line breaks
txt = txt.replace('%', '%25')
txt = txt.replace('\n', '%0A')
txt = txt.replace('\r', '%0D')
Expand Down
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ function(setup_target_for_microphysics_compilation network_name output_dir)
set(networkdir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/")
set(networkheadertemplatefile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/network_header.template")

set (gamma_law_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include
set (gamma_law_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS/gamma_law
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants PARENT_SCOPE)

execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkparamfile}
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkparamfile}
${VODEparamfile} ${integrationparamfile}" --use_namespace WORKING_DIRECTORY ${output_dir}/)

set(gamma_law_sources ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces/eos_data.cpp
Expand All @@ -57,12 +57,12 @@ function(setup_target_for_microphysics_compilation network_name output_dir)
set(networkheadertemplatefile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/network_header.template")

#DO NOT change the order of the directories below!
set (primordial_chem_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/VODE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/utils
set (primordial_chem_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/VODE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/utils
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS/primordial_chem
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants
PARENT_SCOPE)

#we need to have extern_parameters.cpp be available at configure time
Expand All @@ -72,11 +72,11 @@ function(setup_target_for_microphysics_compilation network_name output_dir)
#to generate updated header files

if(BUILD_UNIT_TEST)
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${paramfile} ${EOSparamfile}
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${paramfile} ${EOSparamfile}
${networkpcparamfile} ${networkparamfile} ${VODEparamfile} ${integrationparamfile} ${unittestparamfile}" --use_namespace WORKING_DIRECTORY ${output_dir}/)
else()
#do not need paramfile and unittestparamfile
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkpcparamfile}
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkpcparamfile}
${networkparamfile} ${VODEparamfile} ${integrationparamfile} " --use_namespace WORKING_DIRECTORY ${output_dir}/)
endif()

Expand Down
6 changes: 3 additions & 3 deletions deploy_docs_action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ TARGET_BRANCH="gh-pages"

mkdir out

# if on the dev branch, use the dev_layout.html template to get the
# if on the dev branch, use the dev_layout.html template to get the
# links correct
if [ "$GITHUB_BRANCH" = "$DEV_BRANCH" ]; then
mv sphinx_docs/source/_templates/dev_layout.html sphinx_docs/source/_templates/layout.html
mv sphinx_docs/source/_templates/dev_layout.html sphinx_docs/source/_templates/layout.html
fi

# Build the Sphinx documentation
Expand All @@ -24,7 +24,7 @@ mkdir -p out/docs/
if [ "$GITHUB_BRANCH" = "$MAIN_BRANCH" ]; then
mkdir -p out/docs
mv sphinx_docs/build/html/* out/docs
else
else
mkdir -p out/docs/dev/
mv sphinx_docs/build/html/* out/docs/dev
fi
4 changes: 2 additions & 2 deletions networks/ase/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ def get_library():
print("removing: ", r)
_r = subch.get_rate_by_name(r)
subch.remove_rate(_r)

# additional neutron rates to remove
for r in subch.get_rates():
if (r == subch.get_rate_by_name("mg24(n,a)ne21") or r == subch.get_rate_by_name("ne21(a,n)mg24")
or r == subch.get_rate_by_name("na22(n,g)na23") or r == subch.get_rate_by_name("na23(g,n)na22")
or r == subch.get_rate_by_name("ne21(g,n)ne20") or r == subch.get_rate_by_name("ne20(n,g)ne21")):
continue

if pyna.Nucleus("n") in r.reactants or pyna.Nucleus("n") in r.products:
print("removing neutron rates: ", r)
subch.remove_rate(r)
Expand Down
6 changes: 3 additions & 3 deletions networks/ignition_chamulak/notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ Basic idea:
--- ---

this means that 60% of the time, we will create Ne20 + O16 and
40% of the time we will create Na23 + C13.
40% of the time we will create Na23 + C13.

So the number of nuclei made from consuming 6 C12 is
~ 1.2 Ne20, 1.2 O16, 0.8 Na23, 0.8 C13.


Doing this, the ash has an A = 18 and a Z = 8.8

We also note that since we are operating in a high temperature
Expand All @@ -61,4 +61,4 @@ Basic idea:
release per C12 consumed), as a function of density.



20 changes: 10 additions & 10 deletions networks/rprox/reaclib/make_rates_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def modulePreamble():
def tFactorData():
"""Add a routine to initialize the tfactors given the temperature.
Return this text."""

text="""
contains
Expand All @@ -74,7 +74,7 @@ def tFactorData():

def buildRateRoutine(name,aFactors):
"""Given a reaction name and the list of aFactors from the ReacLib rate
file, build the appropriate structure for the reaction rate as a
file, build the appropriate structure for the reaction rate as a
subroutine. Return this text."""
text= """
subroutine %s(tfactors,rate,dratedt)
Expand Down Expand Up @@ -142,7 +142,7 @@ def buildRateRoutine(name,aFactors):
if not aFactors[start+4] == 0.0:
str += " +ct9 &\n"
if not aFactors[start+5] == 0.0:
str += " +FIVE3RD*ct953 &\n"
str += " +FIVE3RD*ct953 &\n"
if not aFactors[start+6] == 0.0:
str += " +(%sd0))" % (aFactors[start+6])
else:
Expand Down Expand Up @@ -177,7 +177,7 @@ def buildRateRoutine(name,aFactors):
return text

def numReactantsProducts(chapter):
"""Return the number of reactants and products (in particles) for a
"""Return the number of reactants and products (in particles) for a
reaction of ReacLib Chapter type chapter."""
r,p = 1,1
if chapter in [2,5,9,10]: p+= 1
Expand All @@ -190,11 +190,11 @@ def numReactantsProducts(chapter):
return r,p

def parseRateFile(file):
"""Given a ReacLib v 1 rate file, file, parse it and determine an
"""Given a ReacLib v 1 rate file, file, parse it and determine an
appropriate name and the "a" factors that build the rate. Return the
name as a string and the "a" factors as a list."""

try:
try:
fh = open(file,'r')
except IOError:
print "Couldn't open file %f for reading" % file
Expand All @@ -207,7 +207,7 @@ def parseRateFile(file):

foundLabels = False
rateString = "rate"

aFactors = []

for line in data[numHeaderLines:]:
Expand All @@ -226,7 +226,7 @@ def parseRateFile(file):
for term in range(nterms):
start = term*lengthEntry
stop = start + lengthEntry

aFactors.append(float(line[start:stop]))

if len(aFactors) % numTerms is not 0:
Expand Down Expand Up @@ -261,8 +261,8 @@ def weakRate(name,factor):
return textParameter, textSubroutine

def make_rates_module(rateFiles):
"""Build the F90 module containing the subroutines for the reactions
given in the list of ReacLib rate files, rateFiles, along with the helper
"""Build the F90 module containing the subroutines for the reactions
given in the list of ReacLib rate files, rateFiles, along with the helper
routine to set the common temperature factors. Return all this as a string
for easy piping."""

Expand Down
4 changes: 2 additions & 2 deletions sphinx_docs/notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

https://stackoverflow.com/questions/11347505/what-are-some-approaches-to-outputting-a-python-data-structure-to-restructuredte



** index:

use
use

..index:: burn_t
2 changes: 1 addition & 1 deletion sphinx_docs/source/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This will create an executable called ``main3d.gnu.ex``. Then you can run it as
./main3d.gnu.ex inputs_aprox21

By default, the test is built with the 21-isotope ``aprox21`` network.
Here ``inputs_aprox21`` is the inputs file that sets options.
Here ``inputs_aprox21`` is the inputs file that sets options.



Expand Down
8 changes: 4 additions & 4 deletions sphinx_docs/source/integrators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The equations we integrate to do a nuclear burn are:
Here, :math:`X_k` is the mass fraction of species :math:`k`, :math:`e` is the specific
nuclear energy created through reactions. Also needed are density :math:`\rho`,
temperature :math:`T`, and the specific heat. The function :math:`f` provides the energy release from reactions and can often be expressed in terms of the
temperature :math:`T`, and the specific heat. The function :math:`f` provides the energy release from reactions and can often be expressed in terms of the
instantaneous reaction terms, :math:`\dot{X}_k`. As noted in the previous
section, this is implemented in a network-specific manner.

Expand Down Expand Up @@ -70,7 +70,7 @@ routine (at the moment this can be ``VODE``, ``BackwardEuler``, ``ForwardEuler``
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void burner (burn_t& state, Real dt)

The input is a ``burn_t``.
The input is a ``burn_t``.

.. note::

Expand Down Expand Up @@ -369,7 +369,7 @@ the allowed options are:

The spectral radius is estimated by default using the power method,
built into RKC. Alternately, by setting ``integrator.use_circle_theorem=1``,
the `Gershgorin circle theorem <https://en.wikipedia.org/wiki/Gershgorin_circle_theorem>`_
the `Gershgorin circle theorem <https://en.wikipedia.org/wiki/Gershgorin_circle_theorem>`_
is used instead.

* ``VODE``: the VODE :cite:`vode` integration package. We ported this
Expand All @@ -383,7 +383,7 @@ robust.
.. important::

The integrator will not abort if it encounters trouble. Instead it will
set ``burn_t burn_state.success = false`` on exit. It is up to the
set ``burn_t burn_state.success = false`` on exit. It is up to the
application code to handle the failure.

.. note::
Expand Down
2 changes: 1 addition & 1 deletion sphinx_docs/source/networks-overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for the ability to swap integrators as desired. We discuss the
integrators in a later section.

A network is defined by a ``.net`` file which provides a list of species
and some data about each species (its name and some isotopic data).
and some data about each species (its name and some isotopic data).

An example is ``Microphysics/networks/iso7/iso7.net``:

Expand Down
4 changes: 2 additions & 2 deletions sphinx_docs/source/networks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ X_a / (A_a m_u)`, our rate equation is
\begin{align}
\frac{dX_f}{dt} &= - \frac{r_0}{m_u} \rho X_f^2 \frac{1}{A_f} \left (\frac{T}{T_0}\right)^\nu \equiv \omegadot_f \\
\frac{dX_a}{dt} &= \frac{1}{2}\frac{r_0}{m_u} \rho X_f^2 \frac{A_a}{A_f^2} \left (\frac{T}{T_0}\right)^\nu = \frac{r_0}{m_u} \rho X_f^2 \frac{1}{A_f} \left (\frac{T}{T_0}\right)^\nu
\frac{dX_a}{dt} &= \frac{1}{2}\frac{r_0}{m_u} \rho X_f^2 \frac{A_a}{A_f^2} \left (\frac{T}{T_0}\right)^\nu = \frac{r_0}{m_u} \rho X_f^2 \frac{1}{A_f} \left (\frac{T}{T_0}\right)^\nu
\end{align}
We define a new rate constant, :math:`\rt` with units of :math:`[\mathrm{s^{-1}}]` as
Expand Down Expand Up @@ -287,6 +287,6 @@ to disable rates:
:math:`\isotm{N}{13}(\alpha,p)\isotm{O}{16}` and its inverse are
disabled.

Together, these parameters allow us to turn off the sequence
Together, these parameters allow us to turn off the sequence
:math:`\isotm{C}{12}(p,\gamma)\isotm{N}{13}(\alpha, p)\isotm{O}{16}` that
acts as a bypass for :math:`\isotm{C}{12}(\alpha, \gamma)\isotm{O}{16}`.
16 changes: 8 additions & 8 deletions sphinx_docs/source/nse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`.
An example of such reaction cycle would be:

.. math::
\isotm{S}{32} (\gamma, p)(\gamma, p)(\gamma, n)(\gamma, n) \isotm{Si}{28}
(\alpha, \gamma) \isotm{S}{32}
Expand All @@ -265,11 +265,11 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`.
If there are no isotope present in the network that would form a closed-cycle,
we move on to the next nuclei. We break out of the iteration once we found
a fast reaction cycle.

* If the previous two check pass, we proceed to nuclei grouping. Initially,
:math:`p`, :math:`n`, and :math:`\alpha` are grouped into a single group called
the light-isotope-group, or LIG. Other isotopes belong to their own group,
which only contains themselves. During each iteration, we find all valid reaction,
which only contains themselves. During each iteration, we find all valid reaction,
:math:`k`, that has the fastest time-scale,
:math:`t_{i,k} = \tilde{Y}_i/\textbf{min}(b_f(k), b_r(k))`, for :math:`i` to be the isotope
involved with the reaction that is different from :math:`p`, :math:`n`, and :math:`\alpha`.
Expand All @@ -283,13 +283,13 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`.
.. math::
t_{i,k} < \epsilon t_s
*

.. math::
2|b_f(k) - b_r(k)|/(b_f(k) + b_r(k) < \epsilon
Here we only consider two cases of reactions:

* There are exactly two isotopes involved in reaction, :math:`k`, that are not in the
Expand All @@ -307,7 +307,7 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`.
* Reactions that involve more than 2 reactants and products

* Reactions that have more than 2 non-light-isotope-group.

* The nuclei that participate in the reaction is either in LIG or in another group.
This means that the non-LIG nuclei have already merged.

Expand All @@ -320,8 +320,8 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`.
a single group due to the missing neutron rates. Therefore, there is an alternative
criteria of defining a "single group" when neutron is not present in the network:
for isotopes, :math:`Z >= 14`, isotopes with odd and even :math:`N` form two
distinct groups.
distinct groups.


Additional Options
------------------
Expand Down
6 changes: 3 additions & 3 deletions sphinx_docs/source/sdc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ The reactions don’t modify the total density, :math:`\rho`, or momentum,

.. math::
\frac{d}{dt}\left (
\begin{array}{c} \rho X_k \\ \rho e \end{array}
\right ) =
\frac{d}{dt}\left (
\begin{array}{c} \rho X_k \\ \rho e \end{array}
\right ) =
\left ( \begin{array}{c}
\Adv{\rho X_k}^{n+1/2} \\ \Adv{\rho e}^{n+1/2} \\
\end{array} \right ) +
Expand Down
Loading

0 comments on commit 23b5b36

Please sign in to comment.