GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — simple test passes · walshjon/pyne@abf3850

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • decay-gen.py
    • decay.cpp
    • decay.h
    • material.cpp
  • tests
    • test_material.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/decay-gen.py‎

Copy file name to clipboardExpand all lines: src/decay-gen.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from argparse import ArgumentParser, Namespace
88

99
import numpy as np
10+
warnings.simplefilter('ignore', RuntimeWarning)
1011
import tables as tb
1112
import jinja2
1213

Collapse file

‎src/decay.cpp‎

Copy file name to clipboardExpand all lines: src/decay.cpp
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ std::map<int, double> decay(std::map<int, double> comp, double t) {
1616
// setup
1717
using std::map;
1818
int nuc;
19-
double out [3] = {}; // init to zero
19+
double out [4] = {}; // init to zero
2020
map<int, double> outcomp;
2121

2222
// body
@@ -31,6 +31,10 @@ std::map<int, double> decay(std::map<int, double> comp, double t) {
3131
break;
3232
} case 10030000: {
3333
out[2] += (it->second) * (exp2(-2.572085049840012e-09*t));
34+
out[3] += (it->second) * (1.0 - exp2(-2.572085049840012e-09*t));
35+
break;
36+
} case 20030000: {
37+
out[3] += it->second;
3438
break;
3539
} default: {
3640
outcomp.insert(*it);
@@ -40,14 +44,14 @@ std::map<int, double> decay(std::map<int, double> comp, double t) {
4044
}
4145

4246
// cleanup
43-
for (int i = 0; i < 3; ++i)
47+
for (int i = 0; i < 4; ++i)
4448
if (out[i] > 0.0)
4549
outcomp[all_nucs[i]] = out[i];
4650
return outcomp;
4751
}
4852

49-
const int all_nucs [3] = {
50-
10010000, 10020000, 10030000
53+
const int all_nucs [4] = {
54+
10010000, 10020000, 10030000, 20030000
5155
};
5256

5357
} // namespace decayers
Collapse file

‎src/decay.h‎

Copy file name to clipboardExpand all lines: src/decay.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace pyne {
1818
namespace decayers {
1919

20-
extern const int all_nucs[3];
20+
extern const int all_nucs[4];
2121

2222
std::map<int, double> decay(std::map<int, double> comp, double t);
2323

Collapse file

‎src/material.cpp‎

Copy file name to clipboardExpand all lines: src/material.cpp
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,7 @@ pyne::Material pyne::Material::decay(double t) {
15451545
Material rtn;
15461546
comp_map out = pyne::decayers::decay(to_atom_frac(), t);
15471547
rtn.from_atom_frac(out);
1548+
rtn.mass = mass * rtn.molecular_mass() / molecular_mass();
15481549
return rtn;
15491550
};
15501551

Collapse file

‎tests/test_material.py‎

Copy file name to clipboardExpand all lines: tests/test_material.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,9 @@ def test_decay():
16061606
obs = mat.decay(data.half_life('H3'))
16071607
print(mat.to_atom_frac())
16081608
print(obs.to_atom_frac())
1609+
print(mat)
1610+
print(obs)
1611+
assert False
16091612
assert_equal(0.5, obs['H3'])
16101613

16111614

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.