Skip to content

Commit

Permalink
Merge branch 'development' into interp_cxx_test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpkatz authored Aug 15, 2023
2 parents 2002749 + f981413 commit 3487a52
Show file tree
Hide file tree
Showing 32 changed files with 11 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/find_changed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def find_files(SHAs=None):
# see which directories contain changed files
changed_networks = set()
for f in files:
# check for the NETWORK_PROPERTIES file in each parent directory
# check for the actual_network.H file in each parent directory
parts = f.split('/')
while parts:
if os.path.exists(os.path.join(*parts, 'NETWORK_PROPERTIES')):
if os.path.exists(os.path.join(*parts, 'actual_network.H')):
# remove networks/
changed_networks.add(os.path.join(*parts[1:]))
break
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/good_defines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ NONAKA_PLOT
NSE
NSE_NET
NSE_TABLE
NUMSCREEN
RADIATION
RATES
REACTIONS
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 23.09

* The file NETWORK_PROPERTIES has been removed from each network,
as the legacy screening method is no longer used. (#1310)

# 23.07

* The preprocessor variable EXTRA_THERMO has been removed.
Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function(setup_target_for_microphysics_compilation network_name output_dir)

set(networkfile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/gammalaw.net")
set(networkdir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/")
set(networkpropertiesfile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/NETWORK_PROPERTIES")
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
Expand All @@ -55,7 +54,6 @@ function(setup_target_for_microphysics_compilation network_name output_dir)
#similarly, we want network_properties.H
set(networkfile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem/pynucastro.net")
set(networkdir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem/")
set(networkpropertiesfile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem/NETWORK_PROPERTIES")
set(networkheadertemplatefile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/network_header.template")

#DO NOT change the order of the directories below!
Expand Down Expand Up @@ -98,7 +96,7 @@ function(setup_target_for_microphysics_compilation network_name output_dir)

endif()

execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/write_network.py" --header_template "${networkheadertemplatefile}" --header_output "${networkpropfile}" -s "${networkfile}" --other_properties "${networkpropertiesfile}" WORKING_DIRECTORY ${output_dir}/)
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/write_network.py" --header_template "${networkheadertemplatefile}" --header_output "${networkpropfile}" -s "${networkfile}" WORKING_DIRECTORY ${output_dir}/)

endfunction()

Expand Down
1 change: 0 additions & 1 deletion networks/CNO_extras/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/ECSN/NETWORK_PROPERTIES

This file was deleted.

3 changes: 0 additions & 3 deletions networks/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ VPATH_LOCATIONS += $(MICROPHYSICS_UTIL_PATH)

include $(MICROPHYSICS_UTIL_PATH)/Make.package

include $(MICROPHYSICS_HOME)/networks/$(NETWORK_DIR)/NETWORK_PROPERTIES

ifeq ($(USE_REACT), TRUE)

# for backwards compatibility
Expand Down Expand Up @@ -67,7 +65,6 @@ ifeq ($(USE_SCREENING), TRUE)
include $(SCREEN_PATH)/Make.package

DEFINES += -DSCREENING
DEFINES += -DNUMSCREEN=$(NSCREEN)

endif

Expand Down
2 changes: 0 additions & 2 deletions networks/aprox13/NETWORK_PROPERTIES

This file was deleted.

2 changes: 0 additions & 2 deletions networks/aprox19/NETWORK_PROPERTIES

This file was deleted.

2 changes: 0 additions & 2 deletions networks/aprox21/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/ase/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/general_null/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ $(NETWORK_OUTPUT_PATH)/network_properties.H: $(GENERAL_NET_INPUTS)
@if [ ! -d $(NETWORK_OUTPUT_PATH) ]; then mkdir -p $(NETWORK_OUTPUT_PATH); fi
$(MICROPHYSICS_HOME)/networks/general_null/write_network.py \
-s $(GENERAL_NET_INPUTS) \
--other_properties $(MICROPHYSICS_HOME)/networks/general_null/NETWORK_PROPERTIES \
--header_template $(MICROPHYSICS_HOME)/networks/general_null/network_header.template \
--header_output $(NETWORK_OUTPUT_PATH)/network_properties.H \
--defines "$(DEFINES)"
Expand Down
2 changes: 0 additions & 2 deletions networks/general_null/NETWORK_PROPERTIES

This file was deleted.

23 changes: 2 additions & 21 deletions networks/general_null/write_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def abort(outfile):


def write_network(header_template,
net_file, properties_file,
net_file,
header_file, defines):
"""read through the list of species and output the new out_file
Expand All @@ -38,17 +38,6 @@ def write_network(header_template,
if err:
abort(header_file)

properties = {}
try:
with open(properties_file) as f:
for line in f:
if line.strip() == "":
continue
key, value = line.strip().split(":=")
properties[key.strip()] = value.strip()
except FileNotFoundError:
print("no NETWORK_PROPERTIES found, skipping...")

# write out the C++ files based on the templates

templates = [(header_template, header_file, "C++")]
Expand Down Expand Up @@ -168,12 +157,6 @@ def write_network(header_template,
for n, aux in enumerate(aux_vars):
fout.write(f"{indent}\"{aux.name}\", // {n} \n")

elif keyword == "PROPERTIES":
if lang == "C++":
for p in properties:
print(p)
fout.write(f"{indent}constexpr int {p} = {properties[p]};\n")

elif keyword == "SPECIES_ENUM":
if lang == "C++":
for n, spec in enumerate(species):
Expand Down Expand Up @@ -220,15 +203,13 @@ def main():
help="C++ header output file name")
parser.add_argument("-s", type=str, default="",
help="network file name")
parser.add_argument("--other_properties", type=str, default="",
help="a NETWORK_PROPERTIES file with other network properties")
parser.add_argument("--defines", type=str, default="",
help="and preprocessor defines that are used in building the code")

args = parser.parse_args()

write_network(args.header_template,
args.s, args.other_properties,
args.s,
args.header_output, args.defines)

if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion networks/ignition_chamulak/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/ignition_reaclib/C-burn-simple/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/ignition_reaclib/URCA-simple/NETWORK_PROPERTIES

This file was deleted.

2 changes: 0 additions & 2 deletions networks/ignition_simple/NETWORK_PROPERTIES

This file was deleted.

2 changes: 0 additions & 2 deletions networks/iso7/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/nova/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/nova2/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/partition_test/NETWORK_PROPERTIES

This file was deleted.

2 changes: 0 additions & 2 deletions networks/powerlaw/NETWORK_PROPERTIES

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions networks/rprox/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/sn160/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/subch_approx/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/subch_full/NETWORK_PROPERTIES

This file was deleted.

1 change: 0 additions & 1 deletion networks/subch_simple/NETWORK_PROPERTIES

This file was deleted.

2 changes: 0 additions & 2 deletions networks/triple_alpha_plus_cago/NETWORK_PROPERTIES

This file was deleted.

5 changes: 1 addition & 4 deletions networks/update_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ def main():
if not os.path.isfile(net_file):
net_file = os.path.join(micro_path, "networks", net, "pynucastro.net")

properties_file = os.path.join(micro_path, "networks",
net, "NETWORK_PROPERTIES")

cxx_template = os.path.join(micro_path, "networks",
"general_null/network_header.template")
cxx_name = os.path.join(args.odir, "network_properties.H")
Expand All @@ -40,7 +37,7 @@ def main():
pass

write_network.write_network(cxx_template,
net_file, properties_file,
net_file,
cxx_name, args.defines)


Expand Down
2 changes: 0 additions & 2 deletions networks/vode_example/NETWORK_PROPERTIES

This file was deleted.

0 comments on commit 3487a52

Please sign in to comment.