openmc-data 2.2.9__py3-none-any.whl → 2.2.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
openmc_data/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.2.9'
16
- __version_tuple__ = version_tuple = (2, 2, 9)
15
+ __version__ = version = '2.2.10'
16
+ __version_tuple__ = version_tuple = (2, 2, 10)
@@ -97,7 +97,7 @@ def main():
97
97
  reactions = {}
98
98
  for f in neutron_files:
99
99
  evaluation = openmc.data.endf.Evaluation(f)
100
- nuc_name = evaluation.gnd_name
100
+ nuc_name = evaluation.gnds_name
101
101
  if nuc_name in CASL_CHAIN:
102
102
  reactions[nuc_name] = {}
103
103
  for mf, mt, nc, mod in evaluation.reaction_list:
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import argparse
4
+ import ssl
5
+ from pathlib import Path
6
+ from urllib.parse import urljoin
7
+
8
+ import openmc.deplete
9
+
10
+ from openmc_data.utils import download, extract
11
+ from openmc_data import all_decay_release_details
12
+
13
+
14
+ # Parse command line arguments
15
+ parser = argparse.ArgumentParser(prog="generate_jeff_chain",
16
+ description="Generates a OpenMC chain file from JENDL nuclear data files",
17
+ )
18
+ parser.add_argument('-r', '--release', choices=['5.0'],
19
+ default='5.0', help="The nuclear data library release "
20
+ "version. The only currently supported option is 5.0.")
21
+ parser.add_argument(
22
+ "-d",
23
+ "--destination",
24
+ type=Path,
25
+ default=None,
26
+ help="filename of the chain file xml file produced. If left as None then "
27
+ "the filename will follow this format 'chain_jendl_{release}.xml'",
28
+ )
29
+ parser.add_argument(
30
+ "--neutron",
31
+ type=Path,
32
+ default=[],
33
+ nargs="+",
34
+ help="Path to neutron endf files, if not provided, neutron files will be downloaded.",
35
+ )
36
+ parser.add_argument(
37
+ "--decay",
38
+ type=Path,
39
+ default=[],
40
+ nargs="+",
41
+ help="Path to decay data files, if not provided, decay files will be downloaded.",
42
+ )
43
+ parser.add_argument(
44
+ "--fpy",
45
+ type=Path,
46
+ default=[],
47
+ nargs="+",
48
+ help="Path to neutron fission product yield files, if not provided, fission yield files will be downloaded.",
49
+ )
50
+ args = parser.parse_args()
51
+
52
+ def main():
53
+
54
+ library_name = 'jendl'
55
+
56
+ cwd = Path.cwd()
57
+
58
+ # DOWNLOAD NEUTRON DATA
59
+ endf_files_dir = cwd.joinpath('-'.join([library_name, args.release, 'endf']))
60
+ download_path = cwd.joinpath('-'.join([library_name, args.release, 'download']))
61
+ neutron_files = args.neutron
62
+ if not neutron_files:
63
+ details = all_decay_release_details[library_name][args.release]['neutron']
64
+
65
+ for f in details['compressed_files']:
66
+ # Establish connection to URL
67
+ download(
68
+ urljoin(details['base_url'], f),
69
+ context=ssl._create_unverified_context(),
70
+ output_path=download_path
71
+ )
72
+ extract(
73
+ compressed_files=[download_path / f for f in details['compressed_files']],
74
+ extraction_dir=endf_files_dir,
75
+ del_compressed_file=False
76
+ )
77
+ for erratum in details["errata"]:
78
+ files = Path('.').rglob(erratum)
79
+ for p in files:
80
+ p.rename((endf_files_dir / details["endf_files"]).parent / p.name)
81
+ neutron_files = endf_files_dir.glob(details['endf_files'])
82
+
83
+ decay_files = args.decay
84
+ if not decay_files:
85
+ details = all_decay_release_details[library_name][args.release]['decay']
86
+ for base_url, file in zip(details['base_url'], details['compressed_files']):
87
+ downloaded_file = download(
88
+ url=urljoin(base_url, file),
89
+ output_path=Path(".")
90
+ )
91
+
92
+ extract([downloaded_file], Path("."))
93
+ decay_files = list(Path('.').rglob(details["decay_files"]))
94
+
95
+ fpy_files = args.fpy
96
+ if not fpy_files:
97
+ details = all_decay_release_details[library_name][args.release]['nfy']
98
+ for base_url, file in zip(details['base_url'], details['compressed_files']):
99
+ downloaded_file = download(
100
+ url=urljoin(base_url, file),
101
+ output_path=Path(".")
102
+ )
103
+
104
+ extract([downloaded_file], Path("."))
105
+ fpy_files = list(Path('.').rglob(details["nfy_files"]))
106
+
107
+ # check files exist
108
+ for flist, ftype in [(decay_files, "decay"), (neutron_files, "neutron"),
109
+ (fpy_files, "neutron fission product yield")]:
110
+ if not flist:
111
+ raise IOError(f"No {ftype} endf files found in {endf_files_dir}")
112
+
113
+ chain = openmc.deplete.Chain.from_endf(
114
+ decay_files=decay_files,
115
+ fpy_files=fpy_files,
116
+ neutron_files=neutron_files,
117
+ reactions=list(openmc.deplete.chain.REACTIONS.keys())
118
+ )
119
+
120
+ if args.destination is None:
121
+ args.destination = f'chain_{library_name}_{args.release}.xml'
122
+ chain.export_to_xml(args.destination)
123
+ print(f'Chain file written to {args.destination}')
124
+
125
+
126
+ if __name__ == '__main__':
127
+ main()
@@ -47,6 +47,9 @@ parser.add_argument('--cleanup', action='store_true',
47
47
  parser.add_argument('--no-cleanup', dest='cleanup', action='store_false',
48
48
  help="Do not remove download directories when data has "
49
49
  "been processed")
50
+ parser.add_argument('--temperatures', type=float,
51
+ default=[250.0, 293.6, 600.0, 900.0, 1200.0, 2500.0],
52
+ help="Temperatures in Kelvin", nargs='+')
50
53
  parser.set_defaults(download=True, extract=True, cleanup=False)
51
54
  args = parser.parse_args()
52
55
 
@@ -109,7 +112,7 @@ def main():
109
112
  with Pool() as pool:
110
113
  results = []
111
114
  for filename in sorted(neutron_files):
112
- func_args = (filename, args.destination, args.libver)
115
+ func_args = (filename, args.destination, args.libver, args.temperatures)
113
116
  r = pool.apply_async(process_neutron, func_args)
114
117
  results.append(r)
115
118
 
openmc_data/urls_chain.py CHANGED
@@ -70,5 +70,28 @@ all_decay_release_details = {
70
70
  'compressed_files': ['TENDL-n.tgz'],
71
71
  }
72
72
  }
73
+ },
74
+ 'jendl': {
75
+ '5.0': {
76
+ 'neutron': {
77
+ 'base_url': 'https://wwwndc.jaea.go.jp/ftpnd/ftp/JENDL/',
78
+ 'compressed_files': ['jendl5-n.tar.gz', 'jendl5-n_upd1.tar.gz',
79
+ 'jendl5-n_upd6.tar.gz', 'jendl5-n_upd7.tar.gz',
80
+ 'jendl5-n_upd10.tar.gz', 'jendl5-n_upd11.tar.gz',
81
+ 'jendl5-n_upd12.tar.gz'],
82
+ 'endf_files': 'jendl5-n/*.dat',
83
+ 'errata': ['jendl5-n_upd1/*.dat', 'jendl-n_upd6/*.dat', '*.dat'],
84
+ },
85
+ 'decay': {
86
+ 'base_url': ['https://wwwndc.jaea.go.jp/ftpnd/ftp/JENDL/'],
87
+ 'compressed_files': ['jendl5-dec_upd5.tar.gz'],
88
+ 'decay_files': 'jendl5-dec_upd5/*.dat'
89
+ },
90
+ 'nfy': {
91
+ 'base_url': ['https://wwwndc.jaea.go.jp/ftpnd/ftp/JENDL/'],
92
+ 'compressed_files': ['jendl5-fpy_upd8.tar.gz'],
93
+ 'nfy_files': 'jendl5-fpy_upd8/*.dat'
94
+ }
95
+ }
73
96
  }
74
97
  }
openmc_data/utils.py CHANGED
@@ -97,13 +97,14 @@ def extract(
97
97
  extraction_dir : str
98
98
  The directory to extract the files to.
99
99
  del_compressed_file : bool
100
- Wheather the compressed file should be deleted (True) or not (False)
100
+ Whether the compressed file should be deleted (True) or not (False)
101
101
  verbose : bool
102
102
  Controls the printing to terminal, if True filenames of the extracted
103
103
  files will be printed.
104
104
  """
105
105
  Path.mkdir(extraction_dir, parents=True, exist_ok=True)
106
106
 
107
+ print(f'Extracting {compressed_files} to {extraction_dir}')
107
108
  if not isinstance(compressed_files, Iterable):
108
109
  compressed_files = [compressed_files]
109
110
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openmc_data
3
- Version: 2.2.9
3
+ Version: 2.2.10
4
4
  Summary: A Python package containing a collection of scripts for producing and downloading data for OpenMC
5
5
  Author-email: Jonathan Shimwell <mail@jshimwell.com>
6
6
  License: Copyright (c) 2019-2022 UChicago Argonne LLC and contributors
@@ -37,20 +37,14 @@ Requires-Dist: pytest ; extra == 'tests'
37
37
  Requires-Dist: requests ; extra == 'tests'
38
38
 
39
39
  [![test_urls](https://github.com/shimwell/data/actions/workflows/test_urls.yml/badge.svg)](https://github.com/shimwell/data/actions/workflows/test_urls.yml)
40
-
41
40
  [![test_package](https://github.com/openmc-data-storage/openmc_data/actions/workflows/test_package.yml/badge.svg)](https://github.com/openmc-data-storage/openmc_data/actions/workflows/test_package.yml)
42
-
43
41
  [![test_convert_scripts](https://github.com/openmc-data-storage/openmc_data/actions/workflows/test_processing.yml/badge.svg)](https://github.com/openmc-data-storage/openmc_data/actions/workflows/test_processing.yml)
44
42
 
45
43
 
46
- # OpenMC Data Scripts
47
-
48
- This repository contains a collection of scripts for generating HDF5 data
49
- libraries and xml chain files that can be used with OpenMC. Some of these
50
- scripts convert existing ACE libraries (such as those produced by LANL) whereas
51
- generate scripts use NJOY to process ENDF files directly.
44
+ # OpenMC Data
52
45
 
53
- Another source of data libraries for OpenMC is the [Windowed Multipole Library](https://github.com/mit-crpg/WMP_Library) repository which enables on-the-fly Doppler broadening to an arbitrary temperature.
46
+ Aims to facilitate the use of different nuclear data libraries with OpenMC by
47
+ providing command line tools that process and download nuclear data automatically.
54
48
 
55
49
  # Prerequisites
56
50
 
@@ -58,7 +52,7 @@ You should have already installed OpenMC, see the [docs](https://docs.openmc.org
58
52
 
59
53
  # Installation
60
54
 
61
- Currently the package can be installed from this temporary repository.
55
+ The package is distributed on [PYPI](https://pypi.org/project/openmc-data/) and can be installed with pip.
62
56
 
63
57
  ```bash
64
58
  pip install openmc_data
@@ -75,7 +69,7 @@ For example:
75
69
 
76
70
  ```convert_endf --help```
77
71
 
78
- Some scripts (mainly the generate scripts) require NJOY to be installed and
72
+ Some scripts (mainly the generate scripts) require [NJOY](https://github.com/njoy/NJOY2016) to be installed and
79
73
  added to your path.
80
74
 
81
75
  A few categories of scripts are available:
@@ -149,8 +143,9 @@ A few categories of scripts are available:
149
143
  |-|-|-|
150
144
  |generate_endf_chain | ENDF/B | VII.1<br>VIII.0 |
151
145
  |generate_jeff_chain | JEFF | 3.3 |
152
- |generate_serpent_fissq | | |
146
+ |generate_jendl_chain | JENDL | 5.0 |
153
147
  |generate_tendl_chain | TENDL | 2019<br>2021 |
148
+ |generate_serpent_fissq | | |
154
149
  |generate_endf71_chain_casl | ENDF/B | |
155
150
 
156
151
  ### Download chain files
@@ -1,10 +1,10 @@
1
1
  openmc_data/__init__.py,sha256=fOMSqMJm50askApEA9aDzgevM1QC4S-wyAh5xuLdltY,786
2
- openmc_data/_version.py,sha256=qDvE2qxDrFS9MJhnWm3I3M8nf3JNVe9ih8kvL1D5NOU,411
2
+ openmc_data/_version.py,sha256=d5mQhCApviEoLv9v3Wd7yoidvzbXI4mdwskPM3FhIdM,413
3
3
  openmc_data/urls.py,sha256=gbPfJhk7AeL3ZvqEpFBymPEazUR-WZ4t-dZt8J09GPQ,19216
4
- openmc_data/urls_chain.py,sha256=4t_uFjcUD_iH58l9U3gBtcm2We1s2HvTt67xd3ZRJHE,2688
4
+ openmc_data/urls_chain.py,sha256=YGgGcQGq8LgbWJS8uqoB7xwtmIBY-CljAhxUBcOVivY,3774
5
5
  openmc_data/urls_h5.py,sha256=jg6FezS4p-ltNVMzTLw6QVcOdyCzOaiCap7PqbfYFMY,1292
6
6
  openmc_data/urls_xml.py,sha256=g08eB9uvAwz_87f1bEBkUbEESjBNcU9U59NGg7zAHso,1421
7
- openmc_data/utils.py,sha256=7Vx3fbEw6Oakoe1TmlZVEyDjSxYdU4z1tuY8l3EIdCc,7435
7
+ openmc_data/utils.py,sha256=mmYR2RNRe_GZfFU8WPyAlPIcbnOxF33W0BOI4jV0O70,7498
8
8
  openmc_data/convert/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  openmc_data/convert/convert_endf.py,sha256=6pP4wgaPTrCIK4qxOIp2CacFl-tMhQ0XvjDcWoCcI18,6610
10
10
  openmc_data/convert/convert_fendl.py,sha256=VZzdJeq9xx5w8IfsZVRvUZ7JqrlaV-s_1LjBIRdyuuA,10507
@@ -30,9 +30,10 @@ openmc_data/depletion/chain_endf_b8.0_pwr.xml,sha256=iVnUWt79n4J5BKU_ETn-Y5F5dnL
30
30
  openmc_data/depletion/chain_endf_b8.0_sfr.xml,sha256=qmgyj2QJX1F6_OG5X2BZKr6nyiEMEGj6SleZnnO6cSs,27672964
31
31
  openmc_data/depletion/chain_endfb71_pwr.xml,sha256=jAzAlbvI44zzv8xFZgHL1fTf-ZE12U2gDXpPCRBZgaI,1862978
32
32
  openmc_data/depletion/chain_endfb71_sfr.xml,sha256=s0OJwslf-xfNiROgPgY96wg7ddvRvBjKBcISNGjN_yw,1863707
33
- openmc_data/depletion/generate_endf71_chain_casl.py,sha256=OpQi48fMYpAS7i7M5GfetsSatmPJk4cZfHkQokb2dig,11234
33
+ openmc_data/depletion/generate_endf71_chain_casl.py,sha256=YIhVUhGTqmLVNvnWqm9VeZbLLK-y8zAOUA-wjDrjNJc,11235
34
34
  openmc_data/depletion/generate_endf_chain.py,sha256=cIVuoCWYOap1_I7rKgEkNRSMTJzrazcUG5KlkZuZlNc,2964
35
35
  openmc_data/depletion/generate_jeff_chain.py,sha256=9OFiCjXp0WBTr3FO1Wj8zK3-ZBeEcO-3OoIQXf9MRq4,3088
36
+ openmc_data/depletion/generate_jendl_chain.py,sha256=pT6MCybnDNePZlnhn6usWk4ArvuZKVraWVGa4nCGcPo,4224
36
37
  openmc_data/depletion/generate_serpent_fissq.py,sha256=IizN7MwhEB3_V-9oOIOa5c5RYUqYfEeR3TexSKeIuSc,1426
37
38
  openmc_data/depletion/generate_tendl_chain.py,sha256=owQJLiPPUfgFiSQtuQRsCBlALNOcu-0HT5-eambY7ig,5092
38
39
  openmc_data/depletion/reduce_chain.py,sha256=PovyMtc_W_9QhZMU19qlc3w_VJNWgwu0sjWK8do6bHo,1311
@@ -48,16 +49,16 @@ openmc_data/generate/generate_cendl.py,sha256=naeFyC99lLXutl6y9n4qebgMc-k2gMt9XC
48
49
  openmc_data/generate/generate_endf.py,sha256=PUMKt_3bhQSXCVKcY1v7Y3ECUHIOTNPX2QwOSHcHOfc,17971
49
50
  openmc_data/generate/generate_fendl.py,sha256=FuhCKwX25kzFCI6J4aPD9VwuEPAF4DrnB4nRbA3tHLA,4676
50
51
  openmc_data/generate/generate_jeff33.py,sha256=nnLHR85jtrmks0O1bZxhOYNbfNRfB94ZLxZ6-pl3gM4,8698
51
- openmc_data/generate/generate_jendl.py,sha256=w3Px2X9yraBq04W3TLcASRv0loqF3jBUIYVlN3jsqDY,4785
52
+ openmc_data/generate/generate_jendl.py,sha256=haEIpvQPZRBD3ZXoFEps0mBNeYETGYY51Us07jIocLw,4990
52
53
  openmc_data/other/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
54
  openmc_data/other/combine_libraries.py,sha256=HQvR9ppPL_kLoWC478tFLG_hFfug0EmkvW3bN03FYBk,4250
54
55
  openmc_data/other/convert_tendl_rand.py,sha256=F3fq4vQ0kin_FjwAhZm8HP8GzQsk-1gYfWxgKDYN9S0,10619
55
56
  openmc_data/other/make_compton.py,sha256=xsY4fLHWceiRA8tUBVavlZ1TbIDk5HKgikWytEqq6vE,2466
56
57
  openmc_data/other/make_stopping_powers.py,sha256=4Qy9L6VAHm5sMLrDadWX-xS8TSeT-QTiNHDXmZIcT7I,1956
57
58
  openmc_data/other/sample_sandy.py,sha256=uwmZk_XZ59VJOLYqp8cOCruW45qTKzlbeuBwXB6Fk1c,6184
58
- openmc_data-2.2.9.dist-info/LICENSE,sha256=T8b4ZA1twIAqilf_sxR250dAe8AdFhM3k6hqEE0TzBs,1086
59
- openmc_data-2.2.9.dist-info/METADATA,sha256=CKFJvwQe8cGQMElD6oJCQxN232Xy-5jvf6duraqvEV0,9315
60
- openmc_data-2.2.9.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
61
- openmc_data-2.2.9.dist-info/entry_points.txt,sha256=XHn4QdJU5BA7P4NZ-6SYZuXMq5vKXpRhjGZF1reO2hY,1724
62
- openmc_data-2.2.9.dist-info/top_level.txt,sha256=ORU-aSVgJUNjwtVsqnZjP4tvU3QUZZpa-XF90ZnE4MQ,12
63
- openmc_data-2.2.9.dist-info/RECORD,,
59
+ openmc_data-2.2.10.dist-info/LICENSE,sha256=T8b4ZA1twIAqilf_sxR250dAe8AdFhM3k6hqEE0TzBs,1086
60
+ openmc_data-2.2.10.dist-info/METADATA,sha256=Lqcb4WLysM5Lc_1G2SR2e59aKPVJBgsdBSATWjefrb8,9085
61
+ openmc_data-2.2.10.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
62
+ openmc_data-2.2.10.dist-info/entry_points.txt,sha256=H1l5rLT4viSg8fkiiv__vdcWvv8iJC8knU5Oz3gBCC4,1795
63
+ openmc_data-2.2.10.dist-info/top_level.txt,sha256=ORU-aSVgJUNjwtVsqnZjP4tvU3QUZZpa-XF90ZnE4MQ,12
64
+ openmc_data-2.2.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -21,6 +21,7 @@ generate_fendl = openmc_data.generate.generate_fendl:main
21
21
  generate_jeff33 = openmc_data.generate.generate_jeff33:main
22
22
  generate_jeff_chain = openmc_data.depletion.generate_jeff_chain:main
23
23
  generate_jendl = openmc_data.generate.generate_jendl:main
24
+ generate_jendl_chain = openmc_data.depletion.generate_jendl_chain:main
24
25
  generate_serpent_fissq = openmc_data.depletion.generate_serpent_fissq:main
25
26
  generate_tendl_chain = openmc_data.depletion.generate_tendl_chain:main
26
27
  make_compton = openmc_data.other.make_compton:main