TDCRPy 1.9.2__py3-none-any.whl → 1.9.3__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.

Potentially problematic release.


This version of TDCRPy might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TDCRPy
3
- Version: 1.9.2
3
+ Version: 1.9.3
4
4
  Summary: TDCR model
5
5
  Home-page: https://pypi.org/project/TDCRPy/
6
6
  Author: RomainCoulon (Romain Coulon)
@@ -1,6 +1,6 @@
1
- tdcrpy/TDCRPy.py,sha256=8oIQkZDQX16Ztq9AOOr_TI76X6-J1gr5o070ssJ2aYk,53605
1
+ tdcrpy/TDCRPy.py,sha256=qYl8BEI2lLm2oPGrnrxiFya7Y_aQU6dtyutUYHay4Yc,53858
2
2
  tdcrpy/TDCRPy1.py,sha256=QTBZh5B5JWnGB0BQfD-cFmwA9W080OD4sG-aj50-ejo,38106
3
- tdcrpy/TDCR_model_lib.py,sha256=vo44F7QZMsSEYQL_eVx-ZghLRKlWLNXka-3xZdvviWA,98155
3
+ tdcrpy/TDCR_model_lib.py,sha256=e6m0JffgdB8i3cXMpLY8CxRGIpQaBN6zi-woSUqsjR4,101191
4
4
  tdcrpy/TDCRoptimize.py,sha256=c2XIGveeLdVYYek4Rg6dygMvVA2xIrIkMb3L-_jUucM,6496
5
5
  tdcrpy/__init__.py,sha256=vQslGLsoZPIceaitnSHOqN6lUdjEyJ3YhfJ6tYdXt-s,127
6
6
  tdcrpy/config.toml,sha256=rHuuM520HZquGrEd8LAVUdvnzZGtk90pigudy-MXnm8,1389
@@ -1080,8 +1080,8 @@ tdcrpy/docs/_build/html/source/modules.html,sha256=Jf-qxVBId0UgpwyvYuyjtMNG-ezPO
1080
1080
  tdcrpy/docs/_build/html/source/tdcrpy.html,sha256=-38lHMNFB22p1tWJEeN3yDqfDiCYE304vxDamO1-iRc,3779
1081
1081
  tdcrpy/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1082
1082
  tdcrpy/test/test_tdcrpy.py,sha256=MTMiE0N7RiyE8Rom2Yu8kCDR03pJga9D6_o7wr7leVA,4675
1083
- TDCRPy-1.9.2.dist-info/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
1084
- TDCRPy-1.9.2.dist-info/METADATA,sha256=azC14kxwlrAAQ0AC7D2dC7EHwJbFj6GeSyFaHOSnVvw,15995
1085
- TDCRPy-1.9.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
1086
- TDCRPy-1.9.2.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
1087
- TDCRPy-1.9.2.dist-info/RECORD,,
1083
+ TDCRPy-1.9.3.dist-info/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
1084
+ TDCRPy-1.9.3.dist-info/METADATA,sha256=tY2NTgc37inragqtOLmf1lvwoM_z3eCp81XqB3SNyzE,15995
1085
+ TDCRPy-1.9.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
1086
+ TDCRPy-1.9.3.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
1087
+ TDCRPy-1.9.3.dist-info/RECORD,,
tdcrpy/TDCRPy.py CHANGED
@@ -180,6 +180,12 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
180
180
  return out[0], 0, out[1], 0, out[2], 0
181
181
  elif (not Smodel) and (not Rad in radListPureBeta):
182
182
  print("cannot be processed by the analytical model.")
183
+ # print(f"Analytical model used for {Rad}")
184
+ out=tl.modelAnalytical(L,TD,TAB,TBC,TAC,Rad,kB,V,mode,mode2,10000)
185
+ if mode == "res":
186
+ return out
187
+ if mode == "eff":
188
+ return out[0], 0, out[1], 0, out[2], 0
183
189
  else:
184
190
  nE_electron = config["Inputs"].getint("nE_electron")
185
191
  nE_alpha = config["Inputs"].getint("nE_alpha")
tdcrpy/TDCR_model_lib.py CHANGED
@@ -23,6 +23,7 @@ import re
23
23
  import os
24
24
  import scipy.interpolate as interp
25
25
  import matplotlib.pyplot as plt
26
+ import toml
26
27
 
27
28
  """
28
29
  ======= Import ressource data =======
@@ -34,6 +35,10 @@ config = configparser.ConfigParser()
34
35
  with importlib.resources.as_file(files('tdcrpy').joinpath('config.toml')) as data_path:
35
36
  file_conf = data_path
36
37
  config.read(file_conf)
38
+
39
+ nE_electron = config["Inputs"].getint("nE_electron")
40
+ nE_alpha = config["Inputs"].getint("nE_alpha")
41
+ tau = config["Inputs"].getint("tau")
37
42
  RHO = config["Inputs"].getfloat("density")
38
43
  Z = config["Inputs"].getfloat("Z")
39
44
  A = config["Inputs"].getfloat("A")
@@ -43,6 +48,96 @@ Einterp_e = config["Inputs"].getfloat("Einterp_e")
43
48
  diam_micelle = config["Inputs"].getfloat("diam_micelle")
44
49
  fAq = config["Inputs"].getfloat("fAq")
45
50
 
51
+ def readParameters():
52
+ print(f"number of integration bins for electrons = {nE_electron}")
53
+ print(f"number of integration bins for alpha = {nE_alpha}")
54
+ print(f"density = {RHO} g/cm3")
55
+ print(f"Z = {Z}")
56
+ print(f"A = {A}")
57
+ print(f"depth of spline interp. = {depthSpline}")
58
+ print(f"energy above which interp. in implemented (for alpha) = {Einterp_a} keV")
59
+ print(f"energy above which interp. in implemented (for electron) = {Einterp_e} keV")
60
+ print(f"diameter of micelle = {diam_micelle} nm")
61
+ print(f"acqueous fraction = {fAq}")
62
+ return nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau
63
+
64
+ def readConfigAsstr():
65
+ path2config = str(config.read(file_conf)[0])
66
+ with open(path2config, 'r') as file:
67
+ data0 = file.read()
68
+ return data0
69
+
70
+ def writeConfifAsstr(data):
71
+ path2config = str(config.read(file_conf)[0])
72
+ with open(path2config, 'w') as file:
73
+ file.write(data)
74
+
75
+ def modifynE_electron(x):
76
+ data0 = readConfigAsstr()
77
+ x0 = readParameters()[0]
78
+ data1 = data0.replace(f"nE_electron = {x0}",f"nE_electron = {x}")
79
+ writeConfifAsstr(data1)
80
+
81
+ def modifynE_alpha(x):
82
+ data0 = readConfigAsstr()
83
+ x0 = readParameters()[1]
84
+ data1 = data0.replace(f"nE_alpha = {x0}",f"nE_alpha = {x}")
85
+ writeConfifAsstr(data1)
86
+
87
+ def modifyDensity(x):
88
+ data0 = readConfigAsstr()
89
+ x0 = readParameters()[2]
90
+ data1 = data0.replace(f"density = {x0}",f"density = {x}")
91
+ writeConfifAsstr(data1)
92
+
93
+ def modifyZ(x):
94
+ data0 = readConfigAsstr()
95
+ x0 = readParameters()[3]
96
+ data1 = data0.replace(f"Z = {x0}",f"Z = {x}")
97
+ writeConfifAsstr(data1)
98
+
99
+ def modifyA(x):
100
+ data0 = readConfigAsstr()
101
+ x0 = readParameters()[4]
102
+ data1 = data0.replace(f"A = {x0}",f"A = {x}")
103
+ writeConfifAsstr(data1)
104
+
105
+ def modifyDepthSpline(x):
106
+ data0 = readConfigAsstr()
107
+ x0 = readParameters()[5]
108
+ data1 = data0.replace(f"depthSpline = {x0}",f"depthSpline = {x}")
109
+ writeConfifAsstr(data1)
110
+
111
+ def modifyEinterp_a(x):
112
+ data0 = readConfigAsstr()
113
+ x0 = readParameters()[6]
114
+ data1 = data0.replace(f"Einterp_a = {int(x0)}",f"Einterp_a = {int(x)}")
115
+ writeConfifAsstr(data1)
116
+
117
+ def modifyEinterp_e(x):
118
+ data0 = readConfigAsstr()
119
+ x0 = readParameters()[7]
120
+ data1 = data0.replace(f"Einterp_e = {x0}",f"Einterp_e = {x}")
121
+ writeConfifAsstr(data1)
122
+
123
+ def modifyDiam_micelle(x):
124
+ data0 = readConfigAsstr()
125
+ x0 = readParameters()[8]
126
+ data1 = data0.replace(f"diam_micelle = {int(x0)}",f"diam_micelle = {int(x)}")
127
+ writeConfifAsstr(data1)
128
+
129
+ def modifyfAq(x):
130
+ data0 = readConfigAsstr()
131
+ x0 = readParameters()[9]
132
+ data1 = data0.replace(f"fAq = {x0}",f"fAq = {x}")
133
+ writeConfifAsstr(data1)
134
+
135
+ def modifyTau(x):
136
+ data0 = readConfigAsstr()
137
+ x0 = readParameters()[10]
138
+ data1 = data0.replace(f"tau = {x0}",f"tau = {x}")
139
+ writeConfifAsstr(data1)
140
+
46
141
  # import PenNuc data
47
142
  with importlib.resources.as_file(files('tdcrpy').joinpath('decayData')) as data_path:
48
143
  #with importlib.resources.path('tdcrpy', 'decayData') as data_path:
File without changes