repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
NuGrid/NuGridPy | nugridpy/astronomy.py | Pgas | def Pgas(rho,T,mu):
'''
P = R/mu * rho * T
Parameters
----------
mu : float
Mean molecular weight
rho : float
Density [cgs]
T : float
Temperature [K]
'''
R = old_div(boltzmann_constant, atomic_mass_unit)
return (old_div(R,mu)) * rho * T | python | def Pgas(rho,T,mu):
'''
P = R/mu * rho * T
Parameters
----------
mu : float
Mean molecular weight
rho : float
Density [cgs]
T : float
Temperature [K]
'''
R = old_div(boltzmann_constant, atomic_mass_unit)
return (old_div(R,mu)) * rho * T | [
"def",
"Pgas",
"(",
"rho",
",",
"T",
",",
"mu",
")",
":",
"R",
"=",
"old_div",
"(",
"boltzmann_constant",
",",
"atomic_mass_unit",
")",
"return",
"(",
"old_div",
"(",
"R",
",",
"mu",
")",
")",
"*",
"rho",
"*",
"T"
] | P = R/mu * rho * T
Parameters
----------
mu : float
Mean molecular weight
rho : float
Density [cgs]
T : float
Temperature [K] | [
"P",
"=",
"R",
"/",
"mu",
"*",
"rho",
"*",
"T"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L138-L153 |
NuGrid/NuGridPy | nugridpy/astronomy.py | mimf_ferrario | def mimf_ferrario(mi):
''' Curvature MiMf from Ferrario etal. 2005MNRAS.361.1131.'''
mf=-0.00012336*mi**6+0.003160*mi**5-0.02960*mi**4+\
0.12350*mi**3-0.21550*mi**2+0.19022*mi+0.46575
return mf | python | def mimf_ferrario(mi):
''' Curvature MiMf from Ferrario etal. 2005MNRAS.361.1131.'''
mf=-0.00012336*mi**6+0.003160*mi**5-0.02960*mi**4+\
0.12350*mi**3-0.21550*mi**2+0.19022*mi+0.46575
return mf | [
"def",
"mimf_ferrario",
"(",
"mi",
")",
":",
"mf",
"=",
"-",
"0.00012336",
"*",
"mi",
"**",
"6",
"+",
"0.003160",
"*",
"mi",
"**",
"5",
"-",
"0.02960",
"*",
"mi",
"**",
"4",
"+",
"0.12350",
"*",
"mi",
"**",
"3",
"-",
"0.21550",
"*",
"mi",
"**",... | Curvature MiMf from Ferrario etal. 2005MNRAS.361.1131. | [
"Curvature",
"MiMf",
"from",
"Ferrario",
"etal",
".",
"2005MNRAS",
".",
"361",
".",
"1131",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L169-L174 |
NuGrid/NuGridPy | nugridpy/astronomy.py | imf | def imf(m):
'''
Returns
-------
N(M)dM
for given mass according to Kroupa IMF, vectorization
available via vimf()
'''
m1 = 0.08; m2 = 0.50
a1 = 0.30; a2 = 1.30; a3 = 2.3
const2 = m1**-a1 -m1**-a2
const3 = m2**-a2 -m2**-a3
if m < 0.08:
alpha = 0.3
... | python | def imf(m):
'''
Returns
-------
N(M)dM
for given mass according to Kroupa IMF, vectorization
available via vimf()
'''
m1 = 0.08; m2 = 0.50
a1 = 0.30; a2 = 1.30; a3 = 2.3
const2 = m1**-a1 -m1**-a2
const3 = m2**-a2 -m2**-a3
if m < 0.08:
alpha = 0.3
... | [
"def",
"imf",
"(",
"m",
")",
":",
"m1",
"=",
"0.08",
"m2",
"=",
"0.50",
"a1",
"=",
"0.30",
"a2",
"=",
"1.30",
"a3",
"=",
"2.3",
"const2",
"=",
"m1",
"**",
"-",
"a1",
"-",
"m1",
"**",
"-",
"a2",
"const3",
"=",
"m2",
"**",
"-",
"a2",
"-",
"... | Returns
-------
N(M)dM
for given mass according to Kroupa IMF, vectorization
available via vimf() | [
"Returns",
"-------",
"N",
"(",
"M",
")",
"dM",
"for",
"given",
"mass",
"according",
"to",
"Kroupa",
"IMF",
"vectorization",
"available",
"via",
"vimf",
"()"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L193-L218 |
NuGrid/NuGridPy | nugridpy/astronomy.py | int_imf_dm | def int_imf_dm(m1,m2,m,imf,bywhat='bymass',integral='normal'):
'''
Integrate IMF between m1 and m2.
Parameters
----------
m1 : float
Min mass
m2 : float
Max mass
m : float
Mass array
imf : float
IMF array
bywhat : string, optional
'bymass' in... | python | def int_imf_dm(m1,m2,m,imf,bywhat='bymass',integral='normal'):
'''
Integrate IMF between m1 and m2.
Parameters
----------
m1 : float
Min mass
m2 : float
Max mass
m : float
Mass array
imf : float
IMF array
bywhat : string, optional
'bymass' in... | [
"def",
"int_imf_dm",
"(",
"m1",
",",
"m2",
",",
"m",
",",
"imf",
",",
"bywhat",
"=",
"'bymass'",
",",
"integral",
"=",
"'normal'",
")",
":",
"ind_m",
"=",
"(",
"m",
">=",
"min",
"(",
"m1",
",",
"m2",
")",
")",
"&",
"(",
"m",
"<=",
"max",
"(",... | Integrate IMF between m1 and m2.
Parameters
----------
m1 : float
Min mass
m2 : float
Max mass
m : float
Mass array
imf : float
IMF array
bywhat : string, optional
'bymass' integrates the mass that goes into stars of
that mass interval; or 'by... | [
"Integrate",
"IMF",
"between",
"m1",
"and",
"m2",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L223-L263 |
NuGrid/NuGridPy | nugridpy/astronomy.py | am_orb | def am_orb(m1,m2,a,e):
'''
orbital angular momentum.
e.g Ge etal2010
Parameters
----------
m1, m2 : float
Masses of both stars in Msun.
A : float
Separation in Rsun.
e : float
Eccentricity
'''
a_cm = a * rsun_cm
m1_g = m1 * msun_g
... | python | def am_orb(m1,m2,a,e):
'''
orbital angular momentum.
e.g Ge etal2010
Parameters
----------
m1, m2 : float
Masses of both stars in Msun.
A : float
Separation in Rsun.
e : float
Eccentricity
'''
a_cm = a * rsun_cm
m1_g = m1 * msun_g
... | [
"def",
"am_orb",
"(",
"m1",
",",
"m2",
",",
"a",
",",
"e",
")",
":",
"a_cm",
"=",
"a",
"*",
"rsun_cm",
"m1_g",
"=",
"m1",
"*",
"msun_g",
"m2_g",
"=",
"m2",
"*",
"msun_g",
"J_orb",
"=",
"np",
".",
"sqrt",
"(",
"grav_const",
"*",
"a_cm",
"*",
"... | orbital angular momentum.
e.g Ge etal2010
Parameters
----------
m1, m2 : float
Masses of both stars in Msun.
A : float
Separation in Rsun.
e : float
Eccentricity | [
"orbital",
"angular",
"momentum",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L265-L287 |
NuGrid/NuGridPy | nugridpy/astronomy.py | mass_loss_loon05 | def mass_loss_loon05(L,Teff):
'''
mass loss rate van Loon etal (2005).
Parameters
----------
L : float
L in L_sun.
Teff : float
Teff in K.
Returns
-------
Mdot
Mdot in Msun/yr
Notes
-----
ref: van Loon etal 2005, A&A 438, 273
... | python | def mass_loss_loon05(L,Teff):
'''
mass loss rate van Loon etal (2005).
Parameters
----------
L : float
L in L_sun.
Teff : float
Teff in K.
Returns
-------
Mdot
Mdot in Msun/yr
Notes
-----
ref: van Loon etal 2005, A&A 438, 273
... | [
"def",
"mass_loss_loon05",
"(",
"L",
",",
"Teff",
")",
":",
"Mdot",
"=",
"-",
"5.65",
"+",
"np",
".",
"log10",
"(",
"old_div",
"(",
"L",
",",
"10.",
"**",
"4",
")",
")",
"-",
"6.3",
"*",
"np",
".",
"log10",
"(",
"old_div",
"(",
"Teff",
",",
"... | mass loss rate van Loon etal (2005).
Parameters
----------
L : float
L in L_sun.
Teff : float
Teff in K.
Returns
-------
Mdot
Mdot in Msun/yr
Notes
-----
ref: van Loon etal 2005, A&A 438, 273 | [
"mass",
"loss",
"rate",
"van",
"Loon",
"etal",
"(",
"2005",
")",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L289-L312 |
NuGrid/NuGridPy | nugridpy/astronomy.py | energ_orb | def energ_orb(m1,m2,r):
'''
Parameters
----------
m1, m2 : float
M in Msun.
r : float
Distance in Rsun.
Returns
-------
Epot
Epot in erg.
'''
epo = -grav_const * m1 * m2 * msun_g**2 / (r * rsun_cm)
return epo | python | def energ_orb(m1,m2,r):
'''
Parameters
----------
m1, m2 : float
M in Msun.
r : float
Distance in Rsun.
Returns
-------
Epot
Epot in erg.
'''
epo = -grav_const * m1 * m2 * msun_g**2 / (r * rsun_cm)
return epo | [
"def",
"energ_orb",
"(",
"m1",
",",
"m2",
",",
"r",
")",
":",
"epo",
"=",
"-",
"grav_const",
"*",
"m1",
"*",
"m2",
"*",
"msun_g",
"**",
"2",
"/",
"(",
"r",
"*",
"rsun_cm",
")",
"return",
"epo"
] | Parameters
----------
m1, m2 : float
M in Msun.
r : float
Distance in Rsun.
Returns
-------
Epot
Epot in erg. | [
"Parameters",
"----------",
"m1",
"m2",
":",
"float",
"M",
"in",
"Msun",
".",
"r",
":",
"float",
"Distance",
"in",
"Rsun",
".",
"Returns",
"-------",
"Epot",
"Epot",
"in",
"erg",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L314-L330 |
NuGrid/NuGridPy | nugridpy/astronomy.py | period | def period(A,M1,M2):
"""
calculate binary period from separation.
Parameters
----------
A : float
separation A Rsun.
M1, M2 : float
M in Msun.
Returns
-------
p
period in days.
"""
A *= rsun_cm
print(A)
velocity = np.sqrt(grav_const*msun_... | python | def period(A,M1,M2):
"""
calculate binary period from separation.
Parameters
----------
A : float
separation A Rsun.
M1, M2 : float
M in Msun.
Returns
-------
p
period in days.
"""
A *= rsun_cm
print(A)
velocity = np.sqrt(grav_const*msun_... | [
"def",
"period",
"(",
"A",
",",
"M1",
",",
"M2",
")",
":",
"A",
"*=",
"rsun_cm",
"print",
"(",
"A",
")",
"velocity",
"=",
"np",
".",
"sqrt",
"(",
"grav_const",
"*",
"msun_g",
"*",
"(",
"M1",
"+",
"M2",
")",
"/",
"A",
")",
"print",
"(",
"old_d... | calculate binary period from separation.
Parameters
----------
A : float
separation A Rsun.
M1, M2 : float
M in Msun.
Returns
-------
p
period in days. | [
"calculate",
"binary",
"period",
"from",
"separation",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L333-L359 |
NuGrid/NuGridPy | nugridpy/astronomy.py | escape_velocity | def escape_velocity(M,R):
"""
escape velocity.
Parameters
----------
M : float
Mass in solar masses.
R : float
Radius in solar radiu.
Returns
-------
v_escape
in km/s.
"""
ve = np.sqrt(2.*grav_const*M*msun_g/(R*rsun_cm))
ve = ve*1.... | python | def escape_velocity(M,R):
"""
escape velocity.
Parameters
----------
M : float
Mass in solar masses.
R : float
Radius in solar radiu.
Returns
-------
v_escape
in km/s.
"""
ve = np.sqrt(2.*grav_const*M*msun_g/(R*rsun_cm))
ve = ve*1.... | [
"def",
"escape_velocity",
"(",
"M",
",",
"R",
")",
":",
"ve",
"=",
"np",
".",
"sqrt",
"(",
"2.",
"*",
"grav_const",
"*",
"M",
"*",
"msun_g",
"/",
"(",
"R",
"*",
"rsun_cm",
")",
")",
"ve",
"=",
"ve",
"*",
"1.e-5",
"return",
"ve"
] | escape velocity.
Parameters
----------
M : float
Mass in solar masses.
R : float
Radius in solar radiu.
Returns
-------
v_escape
in km/s. | [
"escape",
"velocity",
".",
"Parameters",
"----------",
"M",
":",
"float",
"Mass",
"in",
"solar",
"masses",
".",
"R",
":",
"float",
"Radius",
"in",
"solar",
"radiu",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L361-L381 |
NuGrid/NuGridPy | nugridpy/astronomy.py | Nasv | def Nasv(macs,T):
'''
Returns
-------
Na*<sigma v>
for MACS [mb] at T [K].
'''
Na = avogadro_constant
k = boltzmann_constant
vtherm=(2.*k*T/mass_H_atom)**0.5
s = macs*1.e-27
Nasv = s*vtherm*Na
return Nasv | python | def Nasv(macs,T):
'''
Returns
-------
Na*<sigma v>
for MACS [mb] at T [K].
'''
Na = avogadro_constant
k = boltzmann_constant
vtherm=(2.*k*T/mass_H_atom)**0.5
s = macs*1.e-27
Nasv = s*vtherm*Na
return Nasv | [
"def",
"Nasv",
"(",
"macs",
",",
"T",
")",
":",
"Na",
"=",
"avogadro_constant",
"k",
"=",
"boltzmann_constant",
"vtherm",
"=",
"(",
"2.",
"*",
"k",
"*",
"T",
"/",
"mass_H_atom",
")",
"**",
"0.5",
"s",
"=",
"macs",
"*",
"1.e-27",
"Nasv",
"=",
"s",
... | Returns
-------
Na*<sigma v>
for MACS [mb] at T [K]. | [
"Returns",
"-------",
"Na",
"*",
"<sigma",
"v",
">",
"for",
"MACS",
"[",
"mb",
"]",
"at",
"T",
"[",
"K",
"]",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L384-L399 |
NuGrid/NuGridPy | nugridpy/astronomy.py | macs | def macs(nasv,T):
'''
Returns
-------
MACS
[mb] at T [K] from Na*<sigma v>.
'''
Na = avogadro_constant
k = boltzmann_constant
vtherm=(2.*k*T/mass_H_atom)**0.5
s = old_div(nasv,(vtherm*Na))
macs = s*1.e27
return macs | python | def macs(nasv,T):
'''
Returns
-------
MACS
[mb] at T [K] from Na*<sigma v>.
'''
Na = avogadro_constant
k = boltzmann_constant
vtherm=(2.*k*T/mass_H_atom)**0.5
s = old_div(nasv,(vtherm*Na))
macs = s*1.e27
return macs | [
"def",
"macs",
"(",
"nasv",
",",
"T",
")",
":",
"Na",
"=",
"avogadro_constant",
"k",
"=",
"boltzmann_constant",
"vtherm",
"=",
"(",
"2.",
"*",
"k",
"*",
"T",
"/",
"mass_H_atom",
")",
"**",
"0.5",
"s",
"=",
"old_div",
"(",
"nasv",
",",
"(",
"vtherm"... | Returns
-------
MACS
[mb] at T [K] from Na*<sigma v>. | [
"Returns",
"-------",
"MACS",
"[",
"mb",
"]",
"at",
"T",
"[",
"K",
"]",
"from",
"Na",
"*",
"<sigma",
"v",
">",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L401-L416 |
NuGrid/NuGridPy | nugridpy/astronomy.py | mu_e | def mu_e(X):
'''
mean molecular weight per free electron, assuming full ionisation, and
approximating mu_i/Z_i ~ 2 for all elements heavier then Helium.
(Kippenhahn & Weigert, Ch 13.1, Eq. 13.8)
Parameters
----------
X : float
Mass fraction of H.
'''
try:
... | python | def mu_e(X):
'''
mean molecular weight per free electron, assuming full ionisation, and
approximating mu_i/Z_i ~ 2 for all elements heavier then Helium.
(Kippenhahn & Weigert, Ch 13.1, Eq. 13.8)
Parameters
----------
X : float
Mass fraction of H.
'''
try:
... | [
"def",
"mu_e",
"(",
"X",
")",
":",
"try",
":",
"mu_e",
"=",
"old_div",
"(",
"2.",
",",
"(",
"1.",
"+",
"X",
")",
")",
"except",
"TypeError",
":",
"X",
"=",
"np",
".",
"array",
"(",
"[",
"X",
"]",
")",
"mu_e",
"=",
"old_div",
"(",
"2.",
",",... | mean molecular weight per free electron, assuming full ionisation, and
approximating mu_i/Z_i ~ 2 for all elements heavier then Helium.
(Kippenhahn & Weigert, Ch 13.1, Eq. 13.8)
Parameters
----------
X : float
Mass fraction of H. | [
"mean",
"molecular",
"weight",
"per",
"free",
"electron",
"assuming",
"full",
"ionisation",
"and",
"approximating",
"mu_i",
"/",
"Z_i",
"~",
"2",
"for",
"all",
"elements",
"heavier",
"then",
"Helium",
".",
"(",
"Kippenhahn",
"&",
"Weigert",
"Ch",
"13",
".",
... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L420-L440 |
NuGrid/NuGridPy | nugridpy/astronomy.py | mu | def mu(X,Z,A):
'''
mean molecular weight assuming full ionisation.
(Kippenhahn & Weigert, Ch 13.1, Eq. 13.6)
Parameters
----------
X : float
Mass fraction vector.
Z : float
Charge number vector.
A : float
Mass number vector.
'''
if not... | python | def mu(X,Z,A):
'''
mean molecular weight assuming full ionisation.
(Kippenhahn & Weigert, Ch 13.1, Eq. 13.6)
Parameters
----------
X : float
Mass fraction vector.
Z : float
Charge number vector.
A : float
Mass number vector.
'''
if not... | [
"def",
"mu",
"(",
"X",
",",
"Z",
",",
"A",
")",
":",
"if",
"not",
"isinstance",
"(",
"Z",
",",
"np",
".",
"ndarray",
")",
":",
"Z",
"=",
"np",
".",
"array",
"(",
"Z",
")",
"if",
"not",
"isinstance",
"(",
"A",
",",
"np",
".",
"ndarray",
")",... | mean molecular weight assuming full ionisation.
(Kippenhahn & Weigert, Ch 13.1, Eq. 13.6)
Parameters
----------
X : float
Mass fraction vector.
Z : float
Charge number vector.
A : float
Mass number vector. | [
"mean",
"molecular",
"weight",
"assuming",
"full",
"ionisation",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L442-L474 |
NuGrid/NuGridPy | nugridpy/astronomy.py | Trho_iddeg | def Trho_iddeg(rho,mu,mu_e):
'''
T(rho) that separates ideal gas and degenerate pressure dominated regions.
Kippenhahn & Weigert, Eq. 16.6
Parameters
----------
rho : float
Density array [cgs].
mu : float
Mean molecular weight.
mu_e : float
Mean molecular weigh... | python | def Trho_iddeg(rho,mu,mu_e):
'''
T(rho) that separates ideal gas and degenerate pressure dominated regions.
Kippenhahn & Weigert, Eq. 16.6
Parameters
----------
rho : float
Density array [cgs].
mu : float
Mean molecular weight.
mu_e : float
Mean molecular weigh... | [
"def",
"Trho_iddeg",
"(",
"rho",
",",
"mu",
",",
"mu_e",
")",
":",
"T",
"=",
"1.207E5",
"*",
"rho",
"**",
"(",
"old_div",
"(",
"2.",
",",
"3.",
")",
")",
"*",
"mu",
"/",
"mu_e",
"**",
"(",
"old_div",
"(",
"5.",
",",
"3.",
")",
")",
"return",
... | T(rho) that separates ideal gas and degenerate pressure dominated regions.
Kippenhahn & Weigert, Eq. 16.6
Parameters
----------
rho : float
Density array [cgs].
mu : float
Mean molecular weight.
mu_e : float
Mean molecular weight per free electron. | [
"T",
"(",
"rho",
")",
"that",
"separates",
"ideal",
"gas",
"and",
"degenerate",
"pressure",
"dominated",
"regions",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/astronomy.py#L494-L512 |
openstack/proliantutils | proliantutils/hpssa/disk_allocator.py | _get_criteria_matching_disks | def _get_criteria_matching_disks(logical_disk, physical_drives):
"""Finds the physical drives matching the criteria of logical disk.
This method finds the physical drives matching the criteria
of the logical disk passed.
:param logical_disk: The logical disk dictionary from raid config
:param phys... | python | def _get_criteria_matching_disks(logical_disk, physical_drives):
"""Finds the physical drives matching the criteria of logical disk.
This method finds the physical drives matching the criteria
of the logical disk passed.
:param logical_disk: The logical disk dictionary from raid config
:param phys... | [
"def",
"_get_criteria_matching_disks",
"(",
"logical_disk",
",",
"physical_drives",
")",
":",
"matching_physical_drives",
"=",
"[",
"]",
"criteria_to_consider",
"=",
"[",
"x",
"for",
"x",
"in",
"FILTER_CRITERIA",
"if",
"x",
"in",
"logical_disk",
"]",
"for",
"physi... | Finds the physical drives matching the criteria of logical disk.
This method finds the physical drives matching the criteria
of the logical disk passed.
:param logical_disk: The logical disk dictionary from raid config
:param physical_drives: The physical drives to consider.
:returns: A list of ph... | [
"Finds",
"the",
"physical",
"drives",
"matching",
"the",
"criteria",
"of",
"logical",
"disk",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/hpssa/disk_allocator.py#L21-L44 |
openstack/proliantutils | proliantutils/hpssa/disk_allocator.py | allocate_disks | def allocate_disks(logical_disk, server, raid_config):
"""Allocate physical disks to a logical disk.
This method allocated physical disks to a logical
disk based on the current state of the server and
criteria mentioned in the logical disk.
:param logical_disk: a dictionary of a logical disk
... | python | def allocate_disks(logical_disk, server, raid_config):
"""Allocate physical disks to a logical disk.
This method allocated physical disks to a logical
disk based on the current state of the server and
criteria mentioned in the logical disk.
:param logical_disk: a dictionary of a logical disk
... | [
"def",
"allocate_disks",
"(",
"logical_disk",
",",
"server",
",",
"raid_config",
")",
":",
"size_gb",
"=",
"logical_disk",
"[",
"'size_gb'",
"]",
"raid_level",
"=",
"logical_disk",
"[",
"'raid_level'",
"]",
"number_of_physical_disks",
"=",
"logical_disk",
".",
"ge... | Allocate physical disks to a logical disk.
This method allocated physical disks to a logical
disk based on the current state of the server and
criteria mentioned in the logical disk.
:param logical_disk: a dictionary of a logical disk
from the RAID configuration input to the module.
:param... | [
"Allocate",
"physical",
"disks",
"to",
"a",
"logical",
"disk",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/hpssa/disk_allocator.py#L47-L127 |
NuGrid/NuGridPy | nugridpy/utils.py | trajectory_SgConst | def trajectory_SgConst(Sg=0.1, delta_logt_dex=-0.01):
'''
setup trajectories for constant radiation entropy.
S_gamma/R where the radiation constant R = N_A*k
(Dave Arnett, Supernova book, p. 212)
This relates rho and T but the time scale for this
is independent.
Parameters
----------
... | python | def trajectory_SgConst(Sg=0.1, delta_logt_dex=-0.01):
'''
setup trajectories for constant radiation entropy.
S_gamma/R where the radiation constant R = N_A*k
(Dave Arnett, Supernova book, p. 212)
This relates rho and T but the time scale for this
is independent.
Parameters
----------
... | [
"def",
"trajectory_SgConst",
"(",
"Sg",
"=",
"0.1",
",",
"delta_logt_dex",
"=",
"-",
"0.01",
")",
":",
"# reverse logarithmic time",
"logtimerev",
"=",
"np",
".",
"arange",
"(",
"5.",
",",
"-",
"6.",
",",
"delta_logt_dex",
")",
"logrho",
"=",
"np",
".",
... | setup trajectories for constant radiation entropy.
S_gamma/R where the radiation constant R = N_A*k
(Dave Arnett, Supernova book, p. 212)
This relates rho and T but the time scale for this
is independent.
Parameters
----------
Sg : float
S_gamma/R, values between 0.1 and 10. reflec... | [
"setup",
"trajectories",
"for",
"constant",
"radiation",
"entropy",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L827-L872 |
NuGrid/NuGridPy | nugridpy/utils.py | species_list | def species_list(what_list):
'''
provide default lists of elements to plot.
what_list : string
String name of species lists provided.
If what_list is "CNONe", then C, N, O and some other light
elements.
If what_list is "s-process", then s-process indicators.
'''
i... | python | def species_list(what_list):
'''
provide default lists of elements to plot.
what_list : string
String name of species lists provided.
If what_list is "CNONe", then C, N, O and some other light
elements.
If what_list is "s-process", then s-process indicators.
'''
i... | [
"def",
"species_list",
"(",
"what_list",
")",
":",
"if",
"what_list",
"is",
"\"CNONe\"",
":",
"list_to_print",
"=",
"[",
"'H-1'",
",",
"'He-4'",
",",
"'C-12'",
",",
"'N-14'",
",",
"'O-16'",
",",
"'Ne-20'",
"]",
"elif",
"what_list",
"is",
"\"sprocess\"",
":... | provide default lists of elements to plot.
what_list : string
String name of species lists provided.
If what_list is "CNONe", then C, N, O and some other light
elements.
If what_list is "s-process", then s-process indicators. | [
"provide",
"default",
"lists",
"of",
"elements",
"to",
"plot",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L897-L919 |
NuGrid/NuGridPy | nugridpy/utils.py | linestyle | def linestyle(i,a=5,b=3):
'''
provide one out of 25 unique combinations of style, color and mark
use in combination with markevery=a+mod(i,b) to add spaced points,
here a would be the base spacing that would depend on the data
density, modulated with the number of lines to be plotted (b)
Param... | python | def linestyle(i,a=5,b=3):
'''
provide one out of 25 unique combinations of style, color and mark
use in combination with markevery=a+mod(i,b) to add spaced points,
here a would be the base spacing that would depend on the data
density, modulated with the number of lines to be plotted (b)
Param... | [
"def",
"linestyle",
"(",
"i",
",",
"a",
"=",
"5",
",",
"b",
"=",
"3",
")",
":",
"lines",
"=",
"[",
"'-'",
",",
"'--'",
",",
"'-.'",
",",
"':'",
"]",
"points",
"=",
"[",
"'v'",
",",
"'^'",
",",
"'<'",
",",
"'>'",
",",
"'1'",
",",
"'2'",
",... | provide one out of 25 unique combinations of style, color and mark
use in combination with markevery=a+mod(i,b) to add spaced points,
here a would be the base spacing that would depend on the data
density, modulated with the number of lines to be plotted (b)
Parameters
----------
i : integer
... | [
"provide",
"one",
"out",
"of",
"25",
"unique",
"combinations",
"of",
"style",
"color",
"and",
"mark"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L921-L953 |
NuGrid/NuGridPy | nugridpy/utils.py | colourblind | def colourblind(i):
'''
colour pallete from http://tableaufriction.blogspot.ro/
allegedly suitable for colour-blind folk
SJ
'''
rawRGBs = [(162,200,236),
(255,128,14),
(171,171,171),
(95,158,209),
(89,89,89),
... | python | def colourblind(i):
'''
colour pallete from http://tableaufriction.blogspot.ro/
allegedly suitable for colour-blind folk
SJ
'''
rawRGBs = [(162,200,236),
(255,128,14),
(171,171,171),
(95,158,209),
(89,89,89),
... | [
"def",
"colourblind",
"(",
"i",
")",
":",
"rawRGBs",
"=",
"[",
"(",
"162",
",",
"200",
",",
"236",
")",
",",
"(",
"255",
",",
"128",
",",
"14",
")",
",",
"(",
"171",
",",
"171",
",",
"171",
")",
",",
"(",
"95",
",",
"158",
",",
"209",
")"... | colour pallete from http://tableaufriction.blogspot.ro/
allegedly suitable for colour-blind folk
SJ | [
"colour",
"pallete",
"from",
"http",
":",
"//",
"tableaufriction",
".",
"blogspot",
".",
"ro",
"/",
"allegedly",
"suitable",
"for",
"colour",
"-",
"blind",
"folk"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L955-L979 |
NuGrid/NuGridPy | nugridpy/utils.py | colourblind2 | def colourblind2(i):
'''
another colour pallete from http://www.sron.nl/~pault/
allegedly suitable for colour-blind folk
SJ
'''
hexcols = ['#332288', '#88CCEE', '#44AA99', '#117733', '#999933', '#DDCC77',
'#CC6677', '#882255', '#AA4499']
idx = sc.mod(i,len(hexcol... | python | def colourblind2(i):
'''
another colour pallete from http://www.sron.nl/~pault/
allegedly suitable for colour-blind folk
SJ
'''
hexcols = ['#332288', '#88CCEE', '#44AA99', '#117733', '#999933', '#DDCC77',
'#CC6677', '#882255', '#AA4499']
idx = sc.mod(i,len(hexcol... | [
"def",
"colourblind2",
"(",
"i",
")",
":",
"hexcols",
"=",
"[",
"'#332288'",
",",
"'#88CCEE'",
",",
"'#44AA99'",
",",
"'#117733'",
",",
"'#999933'",
",",
"'#DDCC77'",
",",
"'#CC6677'",
",",
"'#882255'",
",",
"'#AA4499'",
"]",
"idx",
"=",
"sc",
".",
"mod"... | another colour pallete from http://www.sron.nl/~pault/
allegedly suitable for colour-blind folk
SJ | [
"another",
"colour",
"pallete",
"from",
"http",
":",
"//",
"www",
".",
"sron",
".",
"nl",
"/",
"~pault",
"/",
"allegedly",
"suitable",
"for",
"colour",
"-",
"blind",
"folk"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L981-L992 |
NuGrid/NuGridPy | nugridpy/utils.py | linestylecb | def linestylecb(i,a=5,b=3):
'''
version of linestyle function with colourblind colour scheme
returns linetyle, marker, color (see example)
Parameters
----------
i : integer
Number of linestyle combination - there are many....
a : integer
Spacing of m... | python | def linestylecb(i,a=5,b=3):
'''
version of linestyle function with colourblind colour scheme
returns linetyle, marker, color (see example)
Parameters
----------
i : integer
Number of linestyle combination - there are many....
a : integer
Spacing of m... | [
"def",
"linestylecb",
"(",
"i",
",",
"a",
"=",
"5",
",",
"b",
"=",
"3",
")",
":",
"lines",
"=",
"[",
"'-'",
",",
"'--'",
",",
"'-.'",
",",
"':'",
"]",
"points",
"=",
"[",
"'v'",
",",
"'^'",
",",
"'<'",
",",
"'>'",
",",
"'1'",
",",
"'2'",
... | version of linestyle function with colourblind colour scheme
returns linetyle, marker, color (see example)
Parameters
----------
i : integer
Number of linestyle combination - there are many....
a : integer
Spacing of marks. The default is 5.
b : integer... | [
"version",
"of",
"linestyle",
"function",
"with",
"colourblind",
"colour",
"scheme"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L994-L1027 |
NuGrid/NuGridPy | nugridpy/utils.py | symbol_list | def symbol_list(what_list):
'''
provide default symbol lists
Parameters
----------
what_list : string
String name of symbol lists provided; "list1", "list2",
"lines1" or "lines2".
'''
if what_list is "list1":
symbol=['ro','bo','ko','go','mo'\
,'r-','... | python | def symbol_list(what_list):
'''
provide default symbol lists
Parameters
----------
what_list : string
String name of symbol lists provided; "list1", "list2",
"lines1" or "lines2".
'''
if what_list is "list1":
symbol=['ro','bo','ko','go','mo'\
,'r-','... | [
"def",
"symbol_list",
"(",
"what_list",
")",
":",
"if",
"what_list",
"is",
"\"list1\"",
":",
"symbol",
"=",
"[",
"'ro'",
",",
"'bo'",
",",
"'ko'",
",",
"'go'",
",",
"'mo'",
",",
"'r-'",
",",
"'b-'",
",",
"'k-'",
",",
"'g-'",
",",
"'m-'",
",",
"'r--... | provide default symbol lists
Parameters
----------
what_list : string
String name of symbol lists provided; "list1", "list2",
"lines1" or "lines2". | [
"provide",
"default",
"symbol",
"lists"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1030-L1053 |
NuGrid/NuGridPy | nugridpy/utils.py | make_list | def make_list(default_symbol_list, len_list_to_print):
'''
provide the list of symbols to use according for the list of
species/arrays to plot.
Parameters
----------
default_symbol_list : list
Symbols that the user choose to use.
len_list_to_print : integer
len of list of sp... | python | def make_list(default_symbol_list, len_list_to_print):
'''
provide the list of symbols to use according for the list of
species/arrays to plot.
Parameters
----------
default_symbol_list : list
Symbols that the user choose to use.
len_list_to_print : integer
len of list of sp... | [
"def",
"make_list",
"(",
"default_symbol_list",
",",
"len_list_to_print",
")",
":",
"symbol_used",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len_list_to_print",
")",
":",
"symbol_used",
".",
"append",
"(",
"default_symbol_list",
"[",
"sc",
".",
"mod",
... | provide the list of symbols to use according for the list of
species/arrays to plot.
Parameters
----------
default_symbol_list : list
Symbols that the user choose to use.
len_list_to_print : integer
len of list of species/arrays to print. | [
"provide",
"the",
"list",
"of",
"symbols",
"to",
"use",
"according",
"for",
"the",
"list",
"of",
"species",
"/",
"arrays",
"to",
"plot",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1055-L1073 |
NuGrid/NuGridPy | nugridpy/utils.py | strictly_monotonic | def strictly_monotonic(bb):
'''
bb is an index array which may have numerous double or triple
occurrences of indices, such as for example the decay_index_pointer.
This method removes all entries <= -, then all dublicates and
finally returns a sorted list of indices.
'''
cc=bb[np.where(bb>=0... | python | def strictly_monotonic(bb):
'''
bb is an index array which may have numerous double or triple
occurrences of indices, such as for example the decay_index_pointer.
This method removes all entries <= -, then all dublicates and
finally returns a sorted list of indices.
'''
cc=bb[np.where(bb>=0... | [
"def",
"strictly_monotonic",
"(",
"bb",
")",
":",
"cc",
"=",
"bb",
"[",
"np",
".",
"where",
"(",
"bb",
">=",
"0",
")",
"]",
"cc",
".",
"sort",
"(",
")",
"dc",
"=",
"cc",
"[",
"1",
":",
"]",
"-",
"cc",
"[",
":",
"-",
"1",
"]",
"# subsequent ... | bb is an index array which may have numerous double or triple
occurrences of indices, such as for example the decay_index_pointer.
This method removes all entries <= -, then all dublicates and
finally returns a sorted list of indices. | [
"bb",
"is",
"an",
"index",
"array",
"which",
"may",
"have",
"numerous",
"double",
"or",
"triple",
"occurrences",
"of",
"indices",
"such",
"as",
"for",
"example",
"the",
"decay_index_pointer",
".",
"This",
"method",
"removes",
"all",
"entries",
"<",
"=",
"-",... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1075-L1088 |
NuGrid/NuGridPy | nugridpy/utils.py | solar | def solar(filename_solar, solar_factor):
'''
read solar abundances from filename_solar.
Parameters
----------
filename_solar : string
The file name.
solar_factor : float
The correction factor to apply, in case filename_solar is not
solar, but some file used to get initia... | python | def solar(filename_solar, solar_factor):
'''
read solar abundances from filename_solar.
Parameters
----------
filename_solar : string
The file name.
solar_factor : float
The correction factor to apply, in case filename_solar is not
solar, but some file used to get initia... | [
"def",
"solar",
"(",
"filename_solar",
",",
"solar_factor",
")",
":",
"f0",
"=",
"open",
"(",
"filename_solar",
")",
"sol",
"=",
"f0",
".",
"readlines",
"(",
")",
"f0",
".",
"close",
"sol",
"[",
"0",
"]",
".",
"split",
"(",
"\" \"",
")",
"# N... | read solar abundances from filename_solar.
Parameters
----------
filename_solar : string
The file name.
solar_factor : float
The correction factor to apply, in case filename_solar is not
solar, but some file used to get initial abundances at
metallicity lower than solar.... | [
"read",
"solar",
"abundances",
"from",
"filename_solar",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1090-L1160 |
NuGrid/NuGridPy | nugridpy/utils.py | convert_specie_naming_from_h5_to_ppn | def convert_specie_naming_from_h5_to_ppn(isotope_names):
'''
read isotopes names from h5 files, and convert them
according to standard scheme used inside ppn and mppnp. Also
Z and A are recalculated, for these species. Isomers are
excluded for now, since there were recent changes in isomers
nam... | python | def convert_specie_naming_from_h5_to_ppn(isotope_names):
'''
read isotopes names from h5 files, and convert them
according to standard scheme used inside ppn and mppnp. Also
Z and A are recalculated, for these species. Isomers are
excluded for now, since there were recent changes in isomers
nam... | [
"def",
"convert_specie_naming_from_h5_to_ppn",
"(",
"isotope_names",
")",
":",
"spe_rude1",
"=",
"[",
"]",
"spe_rude2",
"=",
"[",
"]",
"spe_rude3",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"isotope_names",
")",
")",
":",
"spe_rude1",
".",... | read isotopes names from h5 files, and convert them
according to standard scheme used inside ppn and mppnp. Also
Z and A are recalculated, for these species. Isomers are
excluded for now, since there were recent changes in isomers
name. As soon as the isomers names are settled, than Z and A
provide... | [
"read",
"isotopes",
"names",
"from",
"h5",
"files",
"and",
"convert",
"them",
"according",
"to",
"standard",
"scheme",
"used",
"inside",
"ppn",
"and",
"mppnp",
".",
"Also",
"Z",
"and",
"A",
"are",
"recalculated",
"for",
"these",
"species",
".",
"Isomers",
... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1163-L1435 |
NuGrid/NuGridPy | nugridpy/utils.py | define_zip_index_for_species | def define_zip_index_for_species(names_ppn_world,
number_names_ppn_world):
''' This just give back cl, that is the original index as it is read from files from a data file.'''
#connect the specie number in the list, with the specie name
global cl
cl={}
for a,b i... | python | def define_zip_index_for_species(names_ppn_world,
number_names_ppn_world):
''' This just give back cl, that is the original index as it is read from files from a data file.'''
#connect the specie number in the list, with the specie name
global cl
cl={}
for a,b i... | [
"def",
"define_zip_index_for_species",
"(",
"names_ppn_world",
",",
"number_names_ppn_world",
")",
":",
"#connect the specie number in the list, with the specie name",
"global",
"cl",
"cl",
"=",
"{",
"}",
"for",
"a",
",",
"b",
"in",
"zip",
"(",
"names_ppn_world",
",",
... | This just give back cl, that is the original index as it is read from files from a data file. | [
"This",
"just",
"give",
"back",
"cl",
"that",
"is",
"the",
"original",
"index",
"as",
"it",
"is",
"read",
"from",
"files",
"from",
"a",
"data",
"file",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1438-L1446 |
NuGrid/NuGridPy | nugridpy/utils.py | element_abund_marco | def element_abund_marco(i_decay, stable_isotope_list,
stable_isotope_identifier,
mass_fractions_array_not_decayed,
mass_fractions_array_decayed):
'''
Given an array of isotopic abundances not decayed and a similar
array of isotopic abun... | python | def element_abund_marco(i_decay, stable_isotope_list,
stable_isotope_identifier,
mass_fractions_array_not_decayed,
mass_fractions_array_decayed):
'''
Given an array of isotopic abundances not decayed and a similar
array of isotopic abun... | [
"def",
"element_abund_marco",
"(",
"i_decay",
",",
"stable_isotope_list",
",",
"stable_isotope_identifier",
",",
"mass_fractions_array_not_decayed",
",",
"mass_fractions_array_decayed",
")",
":",
"# this way is done in a really simple way. May be done better for sure, in a couple of loop... | Given an array of isotopic abundances not decayed and a similar
array of isotopic abundances not decayed, here elements abundances,
and production factors for elements are calculated | [
"Given",
"an",
"array",
"of",
"isotopic",
"abundances",
"not",
"decayed",
"and",
"a",
"similar",
"array",
"of",
"isotopic",
"abundances",
"not",
"decayed",
"here",
"elements",
"abundances",
"and",
"production",
"factors",
"for",
"elements",
"are",
"calculated"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1450-L1509 |
NuGrid/NuGridPy | nugridpy/utils.py | stable_specie | def stable_specie():
''' provide the list of stable species, and decay path feeding stables '''
#import numpy as np
stable_raw=[]
stable_raw = ['H 1', 'H 2',\
'HE 3', 'HE 4',\
'LI 6', 'LI 7',\
'BE 9',\
'B 10', 'B 11',\
'C 12', 'C 13',\
'N 14', 'N 15',\
'O ... | python | def stable_specie():
''' provide the list of stable species, and decay path feeding stables '''
#import numpy as np
stable_raw=[]
stable_raw = ['H 1', 'H 2',\
'HE 3', 'HE 4',\
'LI 6', 'LI 7',\
'BE 9',\
'B 10', 'B 11',\
'C 12', 'C 13',\
'N 14', 'N 15',\
'O ... | [
"def",
"stable_specie",
"(",
")",
":",
"#import numpy as np",
"stable_raw",
"=",
"[",
"]",
"stable_raw",
"=",
"[",
"'H 1'",
",",
"'H 2'",
",",
"'HE 3'",
",",
"'HE 4'",
",",
"'LI 6'",
",",
"'LI 7'",
",",
"'BE 9'",
",",
"'B 10'",
",",
"'B 11'",
",... | provide the list of stable species, and decay path feeding stables | [
"provide",
"the",
"list",
"of",
"stable",
"species",
"and",
"decay",
"path",
"feeding",
"stables"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1512-L1919 |
NuGrid/NuGridPy | nugridpy/utils.py | give_zip_element_z_and_names | def give_zip_element_z_and_names(element_name):
''' create 2 indexes that, given the name of the element/specie, give the atomic number.'''
#import numpy as np
global z_bismuth
z_bismuth = 83
global z_for_elem
z_for_elem = []
global index_stable
index_stable = []
i_for_stable = 1
... | python | def give_zip_element_z_and_names(element_name):
''' create 2 indexes that, given the name of the element/specie, give the atomic number.'''
#import numpy as np
global z_bismuth
z_bismuth = 83
global z_for_elem
z_for_elem = []
global index_stable
index_stable = []
i_for_stable = 1
... | [
"def",
"give_zip_element_z_and_names",
"(",
"element_name",
")",
":",
"#import numpy as np",
"global",
"z_bismuth",
"z_bismuth",
"=",
"83",
"global",
"z_for_elem",
"z_for_elem",
"=",
"[",
"]",
"global",
"index_stable",
"index_stable",
"=",
"[",
"]",
"i_for_stable",
... | create 2 indexes that, given the name of the element/specie, give the atomic number. | [
"create",
"2",
"indexes",
"that",
"given",
"the",
"name",
"of",
"the",
"element",
"/",
"specie",
"give",
"the",
"atomic",
"number",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L1922-L2126 |
NuGrid/NuGridPy | nugridpy/utils.py | get_el_from_z | def get_el_from_z(z):
'''
Very simple Vfunction that gives the atomic number AS A STRING when given the element symbol.
Uses predefined a dictionnary.
Parameter :
z : string or number
For the other way, see get_z_from_el
'''
if(type(z)==float):
z=int(z)
if(type(z)==int):
... | python | def get_el_from_z(z):
'''
Very simple Vfunction that gives the atomic number AS A STRING when given the element symbol.
Uses predefined a dictionnary.
Parameter :
z : string or number
For the other way, see get_z_from_el
'''
if(type(z)==float):
z=int(z)
if(type(z)==int):
... | [
"def",
"get_el_from_z",
"(",
"z",
")",
":",
"if",
"(",
"type",
"(",
"z",
")",
"==",
"float",
")",
":",
"z",
"=",
"int",
"(",
"z",
")",
"if",
"(",
"type",
"(",
"z",
")",
"==",
"int",
")",
":",
"z",
"=",
"str",
"(",
"z",
")",
"dict_z",
"=",... | Very simple Vfunction that gives the atomic number AS A STRING when given the element symbol.
Uses predefined a dictionnary.
Parameter :
z : string or number
For the other way, see get_z_from_el | [
"Very",
"simple",
"Vfunction",
"that",
"gives",
"the",
"atomic",
"number",
"AS",
"A",
"STRING",
"when",
"given",
"the",
"element",
"symbol",
".",
"Uses",
"predefined",
"a",
"dictionnary",
".",
"Parameter",
":",
"z",
":",
"string",
"or",
"number",
"For",
"t... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L2140-L2153 |
NuGrid/NuGridPy | nugridpy/utils.py | data_fitting.fit | def fit(self, x, y, dcoef='none'):
'''
performs the fit
x, y : list
Matching data arrays that define a numerical function y(x),
this is the data to be fitted.
dcoef : list or string
You can provide a different guess for the coefficients, or
... | python | def fit(self, x, y, dcoef='none'):
'''
performs the fit
x, y : list
Matching data arrays that define a numerical function y(x),
this is the data to be fitted.
dcoef : list or string
You can provide a different guess for the coefficients, or
... | [
"def",
"fit",
"(",
"self",
",",
"x",
",",
"y",
",",
"dcoef",
"=",
"'none'",
")",
":",
"self",
".",
"x",
"=",
"x",
"self",
".",
"y",
"=",
"y",
"if",
"dcoef",
"is",
"not",
"'none'",
":",
"coef",
"=",
"dcoef",
"else",
":",
"coef",
"=",
"self",
... | performs the fit
x, y : list
Matching data arrays that define a numerical function y(x),
this is the data to be fitted.
dcoef : list or string
You can provide a different guess for the coefficients, or
provide the string 'none' to use the inital guess. T... | [
"performs",
"the",
"fit"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L139-L171 |
NuGrid/NuGridPy | nugridpy/utils.py | data_fitting.plot | def plot(self, ifig=1, data_label='data', fit_label='fit',
data_shape='o', fit_shape='-'):
'''
plot the data and the fitted function.
Parameters
----------
ifig : integer
Figure window number. The default is 1.
data_label : string
Le... | python | def plot(self, ifig=1, data_label='data', fit_label='fit',
data_shape='o', fit_shape='-'):
'''
plot the data and the fitted function.
Parameters
----------
ifig : integer
Figure window number. The default is 1.
data_label : string
Le... | [
"def",
"plot",
"(",
"self",
",",
"ifig",
"=",
"1",
",",
"data_label",
"=",
"'data'",
",",
"fit_label",
"=",
"'fit'",
",",
"data_shape",
"=",
"'o'",
",",
"fit_shape",
"=",
"'-'",
")",
":",
"if",
"len",
"(",
"self",
".",
"coef",
")",
"is",
"not",
"... | plot the data and the fitted function.
Parameters
----------
ifig : integer
Figure window number. The default is 1.
data_label : string
Legend for data. The default is 'data'.
fit_label : string
Legend for fit. If fit_lable is 'fit', then s... | [
"plot",
"the",
"data",
"and",
"the",
"fitted",
"function",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L173-L203 |
NuGrid/NuGridPy | nugridpy/utils.py | Utils._stable_names | def _stable_names(self):
'''
This private method extracts the element names from stable_el.
Note that stable_names is a misnomer as stable_el also contains
unstable element names with a number 999 for the *stable* mass
numbers. (?!??)
'''
stable_names=[]
... | python | def _stable_names(self):
'''
This private method extracts the element names from stable_el.
Note that stable_names is a misnomer as stable_el also contains
unstable element names with a number 999 for the *stable* mass
numbers. (?!??)
'''
stable_names=[]
... | [
"def",
"_stable_names",
"(",
"self",
")",
":",
"stable_names",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stable_el",
")",
")",
":",
"stable_names",
".",
"append",
"(",
"self",
".",
"stable_el",
"[",
"i",
"]",
"[",
"0"... | This private method extracts the element names from stable_el.
Note that stable_names is a misnomer as stable_el also contains
unstable element names with a number 999 for the *stable* mass
numbers. (?!??) | [
"This",
"private",
"method",
"extracts",
"the",
"element",
"names",
"from",
"stable_el",
".",
"Note",
"that",
"stable_names",
"is",
"a",
"misnomer",
"as",
"stable_el",
"also",
"contains",
"unstable",
"element",
"names",
"with",
"a",
"number",
"999",
"for",
"th... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L261-L272 |
NuGrid/NuGridPy | nugridpy/utils.py | Utils._process_abundance_vector | def _process_abundance_vector(self, a, z, isomers, yps):
'''
This private method takes as input one vector definition and
processes it, including sorting by charge number and
mass number. It returns the processed input variables
plus an element and isotope vector and a list of
... | python | def _process_abundance_vector(self, a, z, isomers, yps):
'''
This private method takes as input one vector definition and
processes it, including sorting by charge number and
mass number. It returns the processed input variables
plus an element and isotope vector and a list of
... | [
"def",
"_process_abundance_vector",
"(",
"self",
",",
"a",
",",
"z",
",",
"isomers",
",",
"yps",
")",
":",
"def",
"cmp_to_key",
"(",
"mycmp",
")",
":",
"'Convert a cmp= function into a key= function'",
"class",
"K",
"(",
"object",
")",
":",
"def",
"__init__",
... | This private method takes as input one vector definition and
processes it, including sorting by charge number and
mass number. It returns the processed input variables
plus an element and isotope vector and a list of
isomers. | [
"This",
"private",
"method",
"takes",
"as",
"input",
"one",
"vector",
"definition",
"and",
"processes",
"it",
"including",
"sorting",
"by",
"charge",
"number",
"and",
"mass",
"number",
".",
"It",
"returns",
"the",
"processed",
"input",
"variables",
"plus",
"an... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L274-L326 |
NuGrid/NuGridPy | nugridpy/utils.py | Utils.compar | def compar(self, x, y):
'''
simple comparator method
'''
indX=0
indY=0
a= int(x[0].split('-')[1])
b= int(y[0].split('-')[1])
if a>b:
return 1
if a==b:
return 0
if a<b:
return -1 | python | def compar(self, x, y):
'''
simple comparator method
'''
indX=0
indY=0
a= int(x[0].split('-')[1])
b= int(y[0].split('-')[1])
if a>b:
return 1
if a==b:
return 0
if a<b:
return -1 | [
"def",
"compar",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"indX",
"=",
"0",
"indY",
"=",
"0",
"a",
"=",
"int",
"(",
"x",
"[",
"0",
"]",
".",
"split",
"(",
"'-'",
")",
"[",
"1",
"]",
")",
"b",
"=",
"int",
"(",
"y",
"[",
"0",
"]",
"."... | simple comparator method | [
"simple",
"comparator",
"method"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L330-L349 |
NuGrid/NuGridPy | nugridpy/utils.py | Utils.comparator | def comparator(self, x, y):
'''
simple comparator method
'''
indX=0
indY=0
for i in range(len(self.stable_names)):
if self.stable_names[i] == x[0].split('-')[0]:
indX=i
if self.stable_names[i] == y[0].split('-')[0]:
... | python | def comparator(self, x, y):
'''
simple comparator method
'''
indX=0
indY=0
for i in range(len(self.stable_names)):
if self.stable_names[i] == x[0].split('-')[0]:
indX=i
if self.stable_names[i] == y[0].split('-')[0]:
... | [
"def",
"comparator",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"indX",
"=",
"0",
"indY",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stable_names",
")",
")",
":",
"if",
"self",
".",
"stable_names",
"[",
"i",
"]",
"==",
... | simple comparator method | [
"simple",
"comparator",
"method"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L351-L370 |
NuGrid/NuGridPy | nugridpy/utils.py | Utils._read_isotopedatabase | def _read_isotopedatabase(self, ffname='isotopedatabase.txt'):
'''
This private method reads the isotopedatabase.txt file in sldir
run dictory and returns z, a, elements, the cutoff mass for each
species that delineate beta+ and beta- decay and the logical in
the last column. Als... | python | def _read_isotopedatabase(self, ffname='isotopedatabase.txt'):
'''
This private method reads the isotopedatabase.txt file in sldir
run dictory and returns z, a, elements, the cutoff mass for each
species that delineate beta+ and beta- decay and the logical in
the last column. Als... | [
"def",
"_read_isotopedatabase",
"(",
"self",
",",
"ffname",
"=",
"'isotopedatabase.txt'",
")",
":",
"name",
"=",
"self",
".",
"sldir",
"+",
"ffname",
"z_db",
",",
"a_db",
",",
"el_db",
",",
"stable_a_db",
",",
"logic_db",
"=",
"np",
".",
"loadtxt",
"(",
... | This private method reads the isotopedatabase.txt file in sldir
run dictory and returns z, a, elements, the cutoff mass for each
species that delineate beta+ and beta- decay and the logical in
the last column. Also provides charge_from_element dictionary
according to isotopedatabase.txt. | [
"This",
"private",
"method",
"reads",
"the",
"isotopedatabase",
".",
"txt",
"file",
"in",
"sldir",
"run",
"dictory",
"and",
"returns",
"z",
"a",
"elements",
"the",
"cutoff",
"mass",
"for",
"each",
"species",
"that",
"delineate",
"beta",
"+",
"and",
"beta",
... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L372-L398 |
NuGrid/NuGridPy | nugridpy/utils.py | Utils.decay_indexpointer | def decay_indexpointer(self):
'''
This private method provides decay indexpointers which allow to
instantaneously decay an abundance vector. These are attributes
are.
Parameters
=================
decay_idp : list
points in the iso_to_plot (i.e. the undecayed abu... | python | def decay_indexpointer(self):
'''
This private method provides decay indexpointers which allow to
instantaneously decay an abundance vector. These are attributes
are.
Parameters
=================
decay_idp : list
points in the iso_to_plot (i.e. the undecayed abu... | [
"def",
"decay_indexpointer",
"(",
"self",
")",
":",
"a_iso_to_plot",
"=",
"self",
".",
"a_iso_to_plot",
"isotope_to_plot",
"=",
"self",
".",
"isotope_to_plot",
"z_iso_to_plot",
"=",
"self",
".",
"z_iso_to_plot",
"el_iso_to_plot",
"=",
"self",
".",
"el_iso_to_plot",
... | This private method provides decay indexpointers which allow to
instantaneously decay an abundance vector. These are attributes
are.
Parameters
=================
decay_idp : list
points in the iso_to_plot (i.e. the undecayed abundance
vector index space) to the deca... | [
"This",
"private",
"method",
"provides",
"decay",
"indexpointers",
"which",
"allow",
"to",
"instantaneously",
"decay",
"an",
"abundance",
"vector",
".",
"These",
"are",
"attributes",
"are",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L400-L499 |
NuGrid/NuGridPy | nugridpy/utils.py | Utils.is_stable | def is_stable(self,species):
'''
This routine accepts input formatted like 'He-3' and checks with
stable_el list if occurs in there. If it does, the routine
returns True, otherwise False.
Notes
-----
this method is designed to work with an se instance from
... | python | def is_stable(self,species):
'''
This routine accepts input formatted like 'He-3' and checks with
stable_el list if occurs in there. If it does, the routine
returns True, otherwise False.
Notes
-----
this method is designed to work with an se instance from
... | [
"def",
"is_stable",
"(",
"self",
",",
"species",
")",
":",
"element_name_of_iso",
"=",
"species",
".",
"split",
"(",
"'-'",
")",
"[",
"0",
"]",
"try",
":",
"a_of_iso",
"=",
"int",
"(",
"species",
".",
"split",
"(",
"'-'",
")",
"[",
"1",
"]",
")",
... | This routine accepts input formatted like 'He-3' and checks with
stable_el list if occurs in there. If it does, the routine
returns True, otherwise False.
Notes
-----
this method is designed to work with an se instance from
nugridse.py. In order to make it work with ppn... | [
"This",
"routine",
"accepts",
"input",
"formatted",
"like",
"He",
"-",
"3",
"and",
"checks",
"with",
"stable_el",
"list",
"if",
"occurs",
"in",
"there",
".",
"If",
"it",
"does",
"the",
"routine",
"returns",
"True",
"otherwise",
"False",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L501-L530 |
NuGrid/NuGridPy | nugridpy/utils.py | iniabu.write | def write(self, outfile='initial_abundance.dat',
header_string='initial abundances for a PPN run'):
'''
Write initial abundance file (intended for use with ppn)
Parameters
----------
outfile : string
Name of output file. The default is
'ini... | python | def write(self, outfile='initial_abundance.dat',
header_string='initial abundances for a PPN run'):
'''
Write initial abundance file (intended for use with ppn)
Parameters
----------
outfile : string
Name of output file. The default is
'ini... | [
"def",
"write",
"(",
"self",
",",
"outfile",
"=",
"'initial_abundance.dat'",
",",
"header_string",
"=",
"'initial abundances for a PPN run'",
")",
":",
"dcols",
"=",
"[",
"'Z'",
",",
"'species'",
",",
"'mass fraction'",
"]",
"data",
"=",
"[",
"self",
".",
"z",... | Write initial abundance file (intended for use with ppn)
Parameters
----------
outfile : string
Name of output file. The default is
'initial_abundance.dat'.
header_string : string
A string with header line. The default is
'initial abunda... | [
"Write",
"initial",
"abundance",
"file",
"(",
"intended",
"for",
"use",
"with",
"ppn",
")"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L657-L676 |
NuGrid/NuGridPy | nugridpy/utils.py | iniabu.write_mesa | def write_mesa(self, mesa_isos_file='isos.txt',
add_excess_iso='fe56', outfile='xa_iniabu.dat',
header_string='initial abundances for a MESA run',
header_char='!'):
'''
Write initial abundance file, returns written abundances and
mesa name... | python | def write_mesa(self, mesa_isos_file='isos.txt',
add_excess_iso='fe56', outfile='xa_iniabu.dat',
header_string='initial abundances for a MESA run',
header_char='!'):
'''
Write initial abundance file, returns written abundances and
mesa name... | [
"def",
"write_mesa",
"(",
"self",
",",
"mesa_isos_file",
"=",
"'isos.txt'",
",",
"add_excess_iso",
"=",
"'fe56'",
",",
"outfile",
"=",
"'xa_iniabu.dat'",
",",
"header_string",
"=",
"'initial abundances for a MESA run'",
",",
"header_char",
"=",
"'!'",
")",
":",
"f... | Write initial abundance file, returns written abundances and
mesa names.
Parameters
----------
mesa_isos_file : string, optional
List with isos copied from mesa network definition file in
mesa/data/net_data/nets. The default is 'isos.txt'.
add_excess_iso... | [
"Write",
"initial",
"abundance",
"file",
"returns",
"written",
"abundances",
"and",
"mesa",
"names",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L678-L749 |
NuGrid/NuGridPy | nugridpy/utils.py | iniabu.set_and_normalize | def set_and_normalize(self,species_hash):
'''
species_hash is a hash array in which you provide abundances
referenced by species names that you want to set to some
particular value; all other species are then normalised so that
the total sum is 1.
Examples
------... | python | def set_and_normalize(self,species_hash):
'''
species_hash is a hash array in which you provide abundances
referenced by species names that you want to set to some
particular value; all other species are then normalised so that
the total sum is 1.
Examples
------... | [
"def",
"set_and_normalize",
"(",
"self",
",",
"species_hash",
")",
":",
"sum_before",
"=",
"sum",
"(",
"self",
".",
"abu",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"species_hash",
")",
")",
":",
"sum_before",
"-=",
"self",
".",
"abu",
"[",
"s... | species_hash is a hash array in which you provide abundances
referenced by species names that you want to set to some
particular value; all other species are then normalised so that
the total sum is 1.
Examples
--------
You can set up the argument array for this method ... | [
"species_hash",
"is",
"a",
"hash",
"array",
"in",
"which",
"you",
"provide",
"abundances",
"referenced",
"by",
"species",
"names",
"that",
"you",
"want",
"to",
"set",
"to",
"some",
"particular",
"value",
";",
"all",
"other",
"species",
"are",
"then",
"normal... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L751-L784 |
NuGrid/NuGridPy | nugridpy/utils.py | iniabu.isoratio_init | def isoratio_init(self,isos):
'''
This file returns the isotopic ratio of two isotopes specified
as iso1 and iso2. The isotopes are given as, e.g.,
['Fe',56,'Fe',58] or ['Fe-56','Fe-58'] (for compatibility)
-> list.
'''
if len(isos) == 2:
dumb = []
... | python | def isoratio_init(self,isos):
'''
This file returns the isotopic ratio of two isotopes specified
as iso1 and iso2. The isotopes are given as, e.g.,
['Fe',56,'Fe',58] or ['Fe-56','Fe-58'] (for compatibility)
-> list.
'''
if len(isos) == 2:
dumb = []
... | [
"def",
"isoratio_init",
"(",
"self",
",",
"isos",
")",
":",
"if",
"len",
"(",
"isos",
")",
"==",
"2",
":",
"dumb",
"=",
"[",
"]",
"dumb",
"=",
"isos",
"[",
"0",
"]",
".",
"split",
"(",
"'-'",
")",
"dumb",
".",
"append",
"(",
"isos",
"[",
"1",... | This file returns the isotopic ratio of two isotopes specified
as iso1 and iso2. The isotopes are given as, e.g.,
['Fe',56,'Fe',58] or ['Fe-56','Fe-58'] (for compatibility)
-> list. | [
"This",
"file",
"returns",
"the",
"isotopic",
"ratio",
"of",
"two",
"isotopes",
"specified",
"as",
"iso1",
"and",
"iso2",
".",
"The",
"isotopes",
"are",
"given",
"as",
"e",
".",
"g",
".",
"[",
"Fe",
"56",
"Fe",
"58",
"]",
"or",
"[",
"Fe",
"-",
"56"... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L789-L804 |
NuGrid/NuGridPy | nugridpy/utils.py | iniabu.iso_abundance | def iso_abundance(self,isos):
'''
This routine returns the abundance of a specific isotope.
Isotope given as, e.g., 'Si-28' or as list
['Si-28','Si-29','Si-30']
'''
if type(isos) == list:
dumb = []
for it in range(len(isos)):
dumb.... | python | def iso_abundance(self,isos):
'''
This routine returns the abundance of a specific isotope.
Isotope given as, e.g., 'Si-28' or as list
['Si-28','Si-29','Si-30']
'''
if type(isos) == list:
dumb = []
for it in range(len(isos)):
dumb.... | [
"def",
"iso_abundance",
"(",
"self",
",",
"isos",
")",
":",
"if",
"type",
"(",
"isos",
")",
"==",
"list",
":",
"dumb",
"=",
"[",
"]",
"for",
"it",
"in",
"range",
"(",
"len",
"(",
"isos",
")",
")",
":",
"dumb",
".",
"append",
"(",
"isos",
"[",
... | This routine returns the abundance of a specific isotope.
Isotope given as, e.g., 'Si-28' or as list
['Si-28','Si-29','Si-30'] | [
"This",
"routine",
"returns",
"the",
"abundance",
"of",
"a",
"specific",
"isotope",
".",
"Isotope",
"given",
"as",
"e",
".",
"g",
".",
"Si",
"-",
"28",
"or",
"as",
"list",
"[",
"Si",
"-",
"28",
"Si",
"-",
"29",
"Si",
"-",
"30",
"]"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/utils.py#L806-L824 |
openstack/proliantutils | proliantutils/redfish/resources/system/storage/physical_drive.py | HPEPhysicalDriveCollection.drive_rotational_speed_rpm | def drive_rotational_speed_rpm(self):
"""Gets the set of rotational speed of the HDD drives"""
drv_rot_speed_rpm = set()
for member in self.get_members():
if member.rotational_speed_rpm is not None:
drv_rot_speed_rpm.add(member.rotational_speed_rpm)
return drv... | python | def drive_rotational_speed_rpm(self):
"""Gets the set of rotational speed of the HDD drives"""
drv_rot_speed_rpm = set()
for member in self.get_members():
if member.rotational_speed_rpm is not None:
drv_rot_speed_rpm.add(member.rotational_speed_rpm)
return drv... | [
"def",
"drive_rotational_speed_rpm",
"(",
"self",
")",
":",
"drv_rot_speed_rpm",
"=",
"set",
"(",
")",
"for",
"member",
"in",
"self",
".",
"get_members",
"(",
")",
":",
"if",
"member",
".",
"rotational_speed_rpm",
"is",
"not",
"None",
":",
"drv_rot_speed_rpm",... | Gets the set of rotational speed of the HDD drives | [
"Gets",
"the",
"set",
"of",
"rotational",
"speed",
"of",
"the",
"HDD",
"drives"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/resources/system/storage/physical_drive.py#L77-L83 |
NuGrid/NuGridPy | nugridpy/grain.py | iso_name_converter | def iso_name_converter(iso):
'''
Converts the name of the given isotope (input), e.g., 'N-14' to
14N as used later to compare w/ grain database.
'''
sp = iso.split('-')
output = sp[1] + sp[0]
return output.lower() | python | def iso_name_converter(iso):
'''
Converts the name of the given isotope (input), e.g., 'N-14' to
14N as used later to compare w/ grain database.
'''
sp = iso.split('-')
output = sp[1] + sp[0]
return output.lower() | [
"def",
"iso_name_converter",
"(",
"iso",
")",
":",
"sp",
"=",
"iso",
".",
"split",
"(",
"'-'",
")",
"output",
"=",
"sp",
"[",
"1",
"]",
"+",
"sp",
"[",
"0",
"]",
"return",
"output",
".",
"lower",
"(",
")"
] | Converts the name of the given isotope (input), e.g., 'N-14' to
14N as used later to compare w/ grain database. | [
"Converts",
"the",
"name",
"of",
"the",
"given",
"isotope",
"(",
"input",
")",
"e",
".",
"g",
".",
"N",
"-",
"14",
"to",
"14N",
"as",
"used",
"later",
"to",
"compare",
"w",
"/",
"grain",
"database",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L1144-L1153 |
NuGrid/NuGridPy | nugridpy/grain.py | get_svnpath | def get_svnpath():
'''
This subroutine gives back the path of the whole svn tree
installation, which is necessary for the script to run.
'''
svnpathtmp = __file__
splitsvnpath = svnpathtmp.split('/')
if len(splitsvnpath) == 1:
svnpath = os.path.abspath('.') + '/../../'
else:
... | python | def get_svnpath():
'''
This subroutine gives back the path of the whole svn tree
installation, which is necessary for the script to run.
'''
svnpathtmp = __file__
splitsvnpath = svnpathtmp.split('/')
if len(splitsvnpath) == 1:
svnpath = os.path.abspath('.') + '/../../'
else:
... | [
"def",
"get_svnpath",
"(",
")",
":",
"svnpathtmp",
"=",
"__file__",
"splitsvnpath",
"=",
"svnpathtmp",
".",
"split",
"(",
"'/'",
")",
"if",
"len",
"(",
"splitsvnpath",
")",
"==",
"1",
":",
"svnpath",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"'.'",
... | This subroutine gives back the path of the whole svn tree
installation, which is necessary for the script to run. | [
"This",
"subroutine",
"gives",
"back",
"the",
"path",
"of",
"the",
"whole",
"svn",
"tree",
"installation",
"which",
"is",
"necessary",
"for",
"the",
"script",
"to",
"run",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L1156-L1170 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.reset_filter | def reset_filter(self):
'''
Resets the filter and goes back to initialized value. This
routine also resets the style if you have changed it.
'''
self.header_desc = self._header_desc
self.header_data = self._header_data
self.header_style = self._header_style
... | python | def reset_filter(self):
'''
Resets the filter and goes back to initialized value. This
routine also resets the style if you have changed it.
'''
self.header_desc = self._header_desc
self.header_data = self._header_data
self.header_style = self._header_style
... | [
"def",
"reset_filter",
"(",
"self",
")",
":",
"self",
".",
"header_desc",
"=",
"self",
".",
"_header_desc",
"self",
".",
"header_data",
"=",
"self",
".",
"_header_data",
"self",
".",
"header_style",
"=",
"self",
".",
"_header_style",
"self",
".",
"desc",
"... | Resets the filter and goes back to initialized value. This
routine also resets the style if you have changed it. | [
"Resets",
"the",
"filter",
"and",
"goes",
"back",
"to",
"initialized",
"value",
".",
"This",
"routine",
"also",
"resets",
"the",
"style",
"if",
"you",
"have",
"changed",
"it",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L133-L147 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.info | def info(self, graintype=True, group=True, reference=False,
phase=True):
'''
This routine gives you informations what kind of grains are
currently available in your filtered version. It gives you
the type of grains available. More to be implemented upon need.
Para... | python | def info(self, graintype=True, group=True, reference=False,
phase=True):
'''
This routine gives you informations what kind of grains are
currently available in your filtered version. It gives you
the type of grains available. More to be implemented upon need.
Para... | [
"def",
"info",
"(",
"self",
",",
"graintype",
"=",
"True",
",",
"group",
"=",
"True",
",",
"reference",
"=",
"False",
",",
"phase",
"=",
"True",
")",
":",
"# create a list with all graintypes",
"gtype_info",
"=",
"[",
"]",
"group_info",
"=",
"[",
"]",
"r... | This routine gives you informations what kind of grains are
currently available in your filtered version. It gives you
the type of grains available. More to be implemented upon need.
Parameters
----------
graintype, group, references, phase : boolean
What do you wa... | [
"This",
"routine",
"gives",
"you",
"informations",
"what",
"kind",
"of",
"grains",
"are",
"currently",
"available",
"in",
"your",
"filtered",
"version",
".",
"It",
"gives",
"you",
"the",
"type",
"of",
"grains",
"available",
".",
"More",
"to",
"be",
"implemen... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L149-L232 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.filter_desc | def filter_desc(self, graintype=None, group=None, reference=None,
size=None, phase=None):
'''
This routine is to filter for description elements. You can
check what is available in the description by running,
>>> i.header_desc()
where i is the instance you ... | python | def filter_desc(self, graintype=None, group=None, reference=None,
size=None, phase=None):
'''
This routine is to filter for description elements. You can
check what is available in the description by running,
>>> i.header_desc()
where i is the instance you ... | [
"def",
"filter_desc",
"(",
"self",
",",
"graintype",
"=",
"None",
",",
"group",
"=",
"None",
",",
"reference",
"=",
"None",
",",
"size",
"=",
"None",
",",
"phase",
"=",
"None",
")",
":",
"# filter for graintype",
"if",
"graintype",
"!=",
"None",
":",
"... | This routine is to filter for description elements. You can
check what is available in the description by running,
>>> i.header_desc()
where i is the instance you loaded.
You can run the filter multiple times! You can filter for the
following types:
Parameters
... | [
"This",
"routine",
"is",
"to",
"filter",
"for",
"description",
"elements",
".",
"You",
"can",
"check",
"what",
"is",
"available",
"in",
"the",
"description",
"by",
"running"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L238-L369 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb._filter_desc | def _filter_desc(self, indexing):
'''
Private function to filter data, goes with filter_desc
'''
# now filter data
if len(indexing) > 0:
desc_tmp = np.zeros((len(indexing),len(self.header_desc)),dtype='|S1024')
data_tmp = np.zeros((len(indexing),len(self... | python | def _filter_desc(self, indexing):
'''
Private function to filter data, goes with filter_desc
'''
# now filter data
if len(indexing) > 0:
desc_tmp = np.zeros((len(indexing),len(self.header_desc)),dtype='|S1024')
data_tmp = np.zeros((len(indexing),len(self... | [
"def",
"_filter_desc",
"(",
"self",
",",
"indexing",
")",
":",
"# now filter data",
"if",
"len",
"(",
"indexing",
")",
">",
"0",
":",
"desc_tmp",
"=",
"np",
".",
"zeros",
"(",
"(",
"len",
"(",
"indexing",
")",
",",
"len",
"(",
"self",
".",
"header_de... | Private function to filter data, goes with filter_desc | [
"Private",
"function",
"to",
"filter",
"data",
"goes",
"with",
"filter_desc"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L372-L394 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.filter_single_grain | def filter_single_grain(self):
'''
This subroutine is to filter out single grains. It is kind of
useless if you have tons of data still in the list. To work on
there, you have other filters (filter_desc and filter_data)
available! This filter gives an index to every grain, plots... | python | def filter_single_grain(self):
'''
This subroutine is to filter out single grains. It is kind of
useless if you have tons of data still in the list. To work on
there, you have other filters (filter_desc and filter_data)
available! This filter gives an index to every grain, plots... | [
"def",
"filter_single_grain",
"(",
"self",
")",
":",
"my_index",
"=",
"0",
"my_grains",
"=",
"[",
"[",
"'Index'",
",",
"'Label'",
",",
"'Type'",
",",
"'Group'",
",",
"'Meteorite'",
",",
"'Mineralogy'",
",",
"'C12/C13'",
",",
"'d(Si29/Si30)'",
",",
"'d(Si30/S... | This subroutine is to filter out single grains. It is kind of
useless if you have tons of data still in the list. To work on
there, you have other filters (filter_desc and filter_data)
available! This filter gives an index to every grain, plots
the most important information, and then a... | [
"This",
"subroutine",
"is",
"to",
"filter",
"out",
"single",
"grains",
".",
"It",
"is",
"kind",
"of",
"useless",
"if",
"you",
"have",
"tons",
"of",
"data",
"still",
"in",
"the",
"list",
".",
"To",
"work",
"on",
"there",
"you",
"have",
"other",
"filters... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L398-L449 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.filter_data | def filter_data(self, isos, limit, delta=True):
'''
This subroutine filters isotopic values according to the limit
you give. You can filter in ratio or in delta space.
Parameters
----------
isos : list
isotopes you want to filter for, e.g., give as
... | python | def filter_data(self, isos, limit, delta=True):
'''
This subroutine filters isotopic values according to the limit
you give. You can filter in ratio or in delta space.
Parameters
----------
isos : list
isotopes you want to filter for, e.g., give as
... | [
"def",
"filter_data",
"(",
"self",
",",
"isos",
",",
"limit",
",",
"delta",
"=",
"True",
")",
":",
"# check availability",
"dat_index",
",",
"delta_b",
",",
"ratio_b",
"=",
"self",
".",
"check_availability",
"(",
"isos",
")",
"if",
"dat_index",
"==",
"-",
... | This subroutine filters isotopic values according to the limit
you give. You can filter in ratio or in delta space.
Parameters
----------
isos : list
isotopes you want to filter for, e.g., give as
['Si-28', 'Si-30'] for the 28/30 ratio.
limit : string
... | [
"This",
"subroutine",
"filters",
"isotopic",
"values",
"according",
"to",
"the",
"limit",
"you",
"give",
".",
"You",
"can",
"filter",
"in",
"ratio",
"or",
"in",
"delta",
"space",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L454-L541 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.style_chg_label | def style_chg_label(self,type,symb=None,edc=None,fac=None,smbsz=None,edw=None,lab=None):
'''
This routine changes the plotting style that is set by default.
The style is changed according the the label that you choose.
Changing according to reference, use style_chg_ref() function!
... | python | def style_chg_label(self,type,symb=None,edc=None,fac=None,smbsz=None,edw=None,lab=None):
'''
This routine changes the plotting style that is set by default.
The style is changed according the the label that you choose.
Changing according to reference, use style_chg_ref() function!
... | [
"def",
"style_chg_label",
"(",
"self",
",",
"type",
",",
"symb",
"=",
"None",
",",
"edc",
"=",
"None",
",",
"fac",
"=",
"None",
",",
"smbsz",
"=",
"None",
",",
"edw",
"=",
"None",
",",
"lab",
"=",
"None",
")",
":",
"# do stuff for selected type",
"fo... | This routine changes the plotting style that is set by default.
The style is changed according the the label that you choose.
Changing according to reference, use style_chg_ref() function!
You can change it back to default by resetting the filter using
g.reset_filter() routine, assuming ... | [
"This",
"routine",
"changes",
"the",
"plotting",
"style",
"that",
"is",
"set",
"by",
"default",
".",
"The",
"style",
"is",
"changed",
"according",
"the",
"the",
"label",
"that",
"you",
"choose",
".",
"Changing",
"according",
"to",
"reference",
"use",
"style_... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L637-L698 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.style_chg_ref | def style_chg_ref(self,ref,symb=None,edc=None,fac=None,smbsz=None,edw=None,lab=None):
'''
This routine changes the plotting style that is set by default.
The style is changed according the the reference of the paper
as given in the grain database. For change according to type of
... | python | def style_chg_ref(self,ref,symb=None,edc=None,fac=None,smbsz=None,edw=None,lab=None):
'''
This routine changes the plotting style that is set by default.
The style is changed according the the reference of the paper
as given in the grain database. For change according to type of
... | [
"def",
"style_chg_ref",
"(",
"self",
",",
"ref",
",",
"symb",
"=",
"None",
",",
"edc",
"=",
"None",
",",
"fac",
"=",
"None",
",",
"smbsz",
"=",
"None",
",",
"edw",
"=",
"None",
",",
"lab",
"=",
"None",
")",
":",
"# do stuff for selected reference",
"... | This routine changes the plotting style that is set by default.
The style is changed according the the reference of the paper
as given in the grain database. For change according to type of
grain, use the routine syle_chg_label().
['Symbol', 'Edge color', 'Face color', 'Symbol size', 'E... | [
"This",
"routine",
"changes",
"the",
"plotting",
"style",
"that",
"is",
"set",
"by",
"default",
".",
"The",
"style",
"is",
"changed",
"according",
"the",
"the",
"reference",
"of",
"the",
"paper",
"as",
"given",
"in",
"the",
"grain",
"database",
".",
"For",... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L700-L757 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.plot_ratio_return | def plot_ratio_return(self, isox, isoy, deltax=True, deltay=True):
'''
This routine returns data isotopic data to plot from the
filtered list of data.
Parameters
----------
isox : list
Isotopes for x axis in standard format ['Si-28','Si-30'].
isoy : l... | python | def plot_ratio_return(self, isox, isoy, deltax=True, deltay=True):
'''
This routine returns data isotopic data to plot from the
filtered list of data.
Parameters
----------
isox : list
Isotopes for x axis in standard format ['Si-28','Si-30'].
isoy : l... | [
"def",
"plot_ratio_return",
"(",
"self",
",",
"isox",
",",
"isoy",
",",
"deltax",
"=",
"True",
",",
"deltay",
"=",
"True",
")",
":",
"# check availability",
"index_x",
",",
"delta_b_x",
",",
"ratio_b_x",
"=",
"self",
".",
"check_availability",
"(",
"isox",
... | This routine returns data isotopic data to plot from the
filtered list of data.
Parameters
----------
isox : list
Isotopes for x axis in standard format ['Si-28','Si-30'].
isoy : list
Same as isox but for y axis.
deltax : boolean, optional
... | [
"This",
"routine",
"returns",
"data",
"isotopic",
"data",
"to",
"plot",
"from",
"the",
"filtered",
"list",
"of",
"data",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L763-L883 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.plot_pattern_return | def plot_pattern_return(self, isos, delta=True):
'''
This routine returns data isotopic data to plot from the
filtered list of data.
Parameters
----------
isos : list
Isotopes for x axis in standard format
[['Si-30','Si-28'],['Si-29','Si-30'],...]... | python | def plot_pattern_return(self, isos, delta=True):
'''
This routine returns data isotopic data to plot from the
filtered list of data.
Parameters
----------
isos : list
Isotopes for x axis in standard format
[['Si-30','Si-28'],['Si-29','Si-30'],...]... | [
"def",
"plot_pattern_return",
"(",
"self",
",",
"isos",
",",
"delta",
"=",
"True",
")",
":",
"# check availability",
"index",
"=",
"[",
"]",
"delta_b",
"=",
"[",
"]",
"ratio_b",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"isos",
")",
... | This routine returns data isotopic data to plot from the
filtered list of data.
Parameters
----------
isos : list
Isotopes for x axis in standard format
[['Si-30','Si-28'],['Si-29','Si-30'],...]
isoy : list
Same as isox but for y axis.
... | [
"This",
"routine",
"returns",
"data",
"isotopic",
"data",
"to",
"plot",
"from",
"the",
"filtered",
"list",
"of",
"data",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L886-L998 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.check_availability | def check_availability(self, isos):
'''
This routine checks if the requested set of isotopes is
available in the dataset.
Parameters
----------
isos : list
set of isotopes in format ['Si-28','Si-30'].
Returns
-------
list
[... | python | def check_availability(self, isos):
'''
This routine checks if the requested set of isotopes is
available in the dataset.
Parameters
----------
isos : list
set of isotopes in format ['Si-28','Si-30'].
Returns
-------
list
[... | [
"def",
"check_availability",
"(",
"self",
",",
"isos",
")",
":",
"# make names",
"iso1name",
"=",
"iso_name_converter",
"(",
"isos",
"[",
"0",
"]",
")",
"iso2name",
"=",
"iso_name_converter",
"(",
"isos",
"[",
"1",
"]",
")",
"ratio",
"=",
"iso1name",
"+",
... | This routine checks if the requested set of isotopes is
available in the dataset.
Parameters
----------
isos : list
set of isotopes in format ['Si-28','Si-30'].
Returns
-------
list
[index, delta_b, ratio_b].
index: where is it.... | [
"This",
"routine",
"checks",
"if",
"the",
"requested",
"set",
"of",
"isotopes",
"is",
"available",
"in",
"the",
"dataset",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L1006-L1059 |
NuGrid/NuGridPy | nugridpy/grain.py | gdb.ratio_to_delta | def ratio_to_delta(self, isos_ss, ratio, oneover=False):
'''
Transforms an isotope ratio into a delta value
Parameters
----------
isos_ss: list or float
list w/ isotopes, e.g., ['N-14','N-15'] OR the solar
system ratio.
ratio : float
r... | python | def ratio_to_delta(self, isos_ss, ratio, oneover=False):
'''
Transforms an isotope ratio into a delta value
Parameters
----------
isos_ss: list or float
list w/ isotopes, e.g., ['N-14','N-15'] OR the solar
system ratio.
ratio : float
r... | [
"def",
"ratio_to_delta",
"(",
"self",
",",
"isos_ss",
",",
"ratio",
",",
"oneover",
"=",
"False",
")",
":",
"# define if isos_ss is the ratio or the isotopes",
"if",
"type",
"(",
"isos_ss",
")",
"==",
"float",
":",
"ss_ratio",
"=",
"isos_ss",
"elif",
"type",
"... | Transforms an isotope ratio into a delta value
Parameters
----------
isos_ss: list or float
list w/ isotopes, e.g., ['N-14','N-15'] OR the solar
system ratio.
ratio : float
ratio of the isotopes to transform.
oneover : boolean
take... | [
"Transforms",
"an",
"isotope",
"ratio",
"into",
"a",
"delta",
"value"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/grain.py#L1063-L1100 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/storageclient.py | StorageClient.with_filter | def with_filter(self, filter):
'''
Returns a new service which will process requests with the specified
filter. Filtering operations can include logging, automatic retrying,
etc... The filter is a lambda which receives the HTTPRequest and
another lambda. The filter can perform an... | python | def with_filter(self, filter):
'''
Returns a new service which will process requests with the specified
filter. Filtering operations can include logging, automatic retrying,
etc... The filter is a lambda which receives the HTTPRequest and
another lambda. The filter can perform an... | [
"def",
"with_filter",
"(",
"self",
",",
"filter",
")",
":",
"res",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"old_filter",
"=",
"self",
".",
"_filter",
"def",
"new_filter",
"(",
"request",
")",
":",
"return",
"filter",
"(",
"request",
",",
"old_f... | Returns a new service which will process requests with the specified
filter. Filtering operations can include logging, automatic retrying,
etc... The filter is a lambda which receives the HTTPRequest and
another lambda. The filter can perform any pre-processing on the
request, pass it of... | [
"Returns",
"a",
"new",
"service",
"which",
"will",
"process",
"requests",
"with",
"the",
"specified",
"filter",
".",
"Filtering",
"operations",
"can",
"include",
"logging",
"automatic",
"retrying",
"etc",
"...",
"The",
"filter",
"is",
"a",
"lambda",
"which",
"... | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/storageclient.py#L70-L90 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/storageclient.py | StorageClient._perform_request | def _perform_request(self, request, encoding='utf-8'):
'''
Sends the request and return response. Catches HTTPError and hands it
to error handler
'''
try:
resp = self._filter(request)
if sys.version_info >= (3,) and isinstance(resp, bytes) and \
... | python | def _perform_request(self, request, encoding='utf-8'):
'''
Sends the request and return response. Catches HTTPError and hands it
to error handler
'''
try:
resp = self._filter(request)
if sys.version_info >= (3,) and isinstance(resp, bytes) and \
... | [
"def",
"_perform_request",
"(",
"self",
",",
"request",
",",
"encoding",
"=",
"'utf-8'",
")",
":",
"try",
":",
"resp",
"=",
"self",
".",
"_filter",
"(",
"request",
")",
"if",
"sys",
".",
"version_info",
">=",
"(",
"3",
",",
")",
"and",
"isinstance",
... | Sends the request and return response. Catches HTTPError and hands it
to error handler | [
"Sends",
"the",
"request",
"and",
"return",
"response",
".",
"Catches",
"HTTPError",
"and",
"hands",
"it",
"to",
"error",
"handler"
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/storageclient.py#L111-L139 |
openstack/proliantutils | proliantutils/ilo/client.py | IloClient._validate_snmp | def _validate_snmp(self):
"""Validates SNMP credentials.
:raises exception.IloInvalidInputError
"""
cred = self.snmp_credentials
if cred is not None:
if cred.get('snmp_inspection') is True:
if not all([cred.get('auth_user'),
... | python | def _validate_snmp(self):
"""Validates SNMP credentials.
:raises exception.IloInvalidInputError
"""
cred = self.snmp_credentials
if cred is not None:
if cred.get('snmp_inspection') is True:
if not all([cred.get('auth_user'),
... | [
"def",
"_validate_snmp",
"(",
"self",
")",
":",
"cred",
"=",
"self",
".",
"snmp_credentials",
"if",
"cred",
"is",
"not",
"None",
":",
"if",
"cred",
".",
"get",
"(",
"'snmp_inspection'",
")",
"is",
"True",
":",
"if",
"not",
"all",
"(",
"[",
"cred",
".... | Validates SNMP credentials.
:raises exception.IloInvalidInputError | [
"Validates",
"SNMP",
"credentials",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/client.py#L192-L242 |
openstack/proliantutils | proliantutils/ilo/client.py | IloClient._call_method | def _call_method(self, method_name, *args, **kwargs):
"""Call the corresponding method using RIBCL, RIS or REDFISH
Make the decision to invoke the corresponding method using RIBCL,
RIS or REDFISH way. In case of none, throw out ``NotImplementedError``
"""
if self.use_redfish_onl... | python | def _call_method(self, method_name, *args, **kwargs):
"""Call the corresponding method using RIBCL, RIS or REDFISH
Make the decision to invoke the corresponding method using RIBCL,
RIS or REDFISH way. In case of none, throw out ``NotImplementedError``
"""
if self.use_redfish_onl... | [
"def",
"_call_method",
"(",
"self",
",",
"method_name",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"use_redfish_only",
":",
"if",
"method_name",
"in",
"SUPPORTED_REDFISH_METHODS",
":",
"the_operation_object",
"=",
"self",
".",
"r... | Call the corresponding method using RIBCL, RIS or REDFISH
Make the decision to invoke the corresponding method using RIBCL,
RIS or REDFISH way. In case of none, throw out ``NotImplementedError`` | [
"Call",
"the",
"corresponding",
"method",
"using",
"RIBCL",
"RIS",
"or",
"REDFISH"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/client.py#L244-L274 |
openstack/proliantutils | proliantutils/ilo/client.py | IloClient.set_iscsi_info | def set_iscsi_info(self, target_name, lun, ip_address,
port='3260', auth_method=None, username=None,
password=None):
"""Set iscsi details of the system in uefi boot mode.
The initiator system is set with the target details like
IQN, LUN, IP, Port et... | python | def set_iscsi_info(self, target_name, lun, ip_address,
port='3260', auth_method=None, username=None,
password=None):
"""Set iscsi details of the system in uefi boot mode.
The initiator system is set with the target details like
IQN, LUN, IP, Port et... | [
"def",
"set_iscsi_info",
"(",
"self",
",",
"target_name",
",",
"lun",
",",
"ip_address",
",",
"port",
"=",
"'3260'",
",",
"auth_method",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"return",
"self",
".",
"_call_meth... | Set iscsi details of the system in uefi boot mode.
The initiator system is set with the target details like
IQN, LUN, IP, Port etc.
:param target_name: Target Name for iscsi.
:param lun: logical unit number.
:param ip_address: IP address of the target.
:param port: port ... | [
"Set",
"iscsi",
"details",
"of",
"the",
"system",
"in",
"uefi",
"boot",
"mode",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/client.py#L308-L328 |
openstack/proliantutils | proliantutils/ilo/client.py | IloClient.set_iscsi_boot_info | def set_iscsi_boot_info(self, mac, target_name, lun, ip_address,
port='3260', auth_method=None, username=None,
password=None):
"""Set iscsi details of the system in uefi boot mode.
The initiator system is set with the target details like
I... | python | def set_iscsi_boot_info(self, mac, target_name, lun, ip_address,
port='3260', auth_method=None, username=None,
password=None):
"""Set iscsi details of the system in uefi boot mode.
The initiator system is set with the target details like
I... | [
"def",
"set_iscsi_boot_info",
"(",
"self",
",",
"mac",
",",
"target_name",
",",
"lun",
",",
"ip_address",
",",
"port",
"=",
"'3260'",
",",
"auth_method",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"LOG",
".",
"wa... | Set iscsi details of the system in uefi boot mode.
The initiator system is set with the target details like
IQN, LUN, IP, Port etc.
:param mac: The MAC of the NIC to be set with iSCSI information
:param target_name: Target Name for iscsi.
:param lun: logical unit number.
... | [
"Set",
"iscsi",
"details",
"of",
"the",
"system",
"in",
"uefi",
"boot",
"mode",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/client.py#L330-L353 |
openstack/proliantutils | proliantutils/ilo/client.py | IloClient.set_vm_status | def set_vm_status(self, device='FLOPPY',
boot_option='BOOT_ONCE', write_protect='YES'):
"""Sets the Virtual Media drive status and allows the
boot options for booting from the virtual media.
"""
return self._call_method('set_vm_status', device, boot_option,
... | python | def set_vm_status(self, device='FLOPPY',
boot_option='BOOT_ONCE', write_protect='YES'):
"""Sets the Virtual Media drive status and allows the
boot options for booting from the virtual media.
"""
return self._call_method('set_vm_status', device, boot_option,
... | [
"def",
"set_vm_status",
"(",
"self",
",",
"device",
"=",
"'FLOPPY'",
",",
"boot_option",
"=",
"'BOOT_ONCE'",
",",
"write_protect",
"=",
"'YES'",
")",
":",
"return",
"self",
".",
"_call_method",
"(",
"'set_vm_status'",
",",
"device",
",",
"boot_option",
",",
... | Sets the Virtual Media drive status and allows the
boot options for booting from the virtual media. | [
"Sets",
"the",
"Virtual",
"Media",
"drive",
"status",
"and",
"allows",
"the"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/client.py#L438-L445 |
openstack/proliantutils | proliantutils/ilo/client.py | IloClient.get_essential_properties | def get_essential_properties(self):
"""Get the essential scheduling properties
:returns: a dictionary containing memory size, disk size,
number of cpus, cpu arch, port numbers and
mac addresses.
:raises: IloError, on an error from iLO.
:raises: IloCom... | python | def get_essential_properties(self):
"""Get the essential scheduling properties
:returns: a dictionary containing memory size, disk size,
number of cpus, cpu arch, port numbers and
mac addresses.
:raises: IloError, on an error from iLO.
:raises: IloCom... | [
"def",
"get_essential_properties",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"_call_method",
"(",
"'get_essential_properties'",
")",
"if",
"(",
"data",
"[",
"'properties'",
"]",
"[",
"'local_gb'",
"]",
"==",
"0",
")",
":",
"cred",
"=",
"self",
".",
... | Get the essential scheduling properties
:returns: a dictionary containing memory size, disk size,
number of cpus, cpu arch, port numbers and
mac addresses.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not su... | [
"Get",
"the",
"essential",
"scheduling",
"properties"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/client.py#L594-L621 |
openstack/proliantutils | proliantutils/ilo/client.py | IloClient.get_server_capabilities | def get_server_capabilities(self):
"""Get hardware properties which can be used for scheduling
:return: a dictionary of server capabilities.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
... | python | def get_server_capabilities(self):
"""Get hardware properties which can be used for scheduling
:return: a dictionary of server capabilities.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
... | [
"def",
"get_server_capabilities",
"(",
"self",
")",
":",
"capabilities",
"=",
"self",
".",
"_call_method",
"(",
"'get_server_capabilities'",
")",
"# TODO(nisha): Assumption is that Redfish always see the pci_device",
"# member name field populated similarly to IPMI.",
"# If redfish i... | Get hardware properties which can be used for scheduling
:return: a dictionary of server capabilities.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Get",
"hardware",
"properties",
"which",
"can",
"be",
"used",
"for",
"scheduling"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/client.py#L623-L651 |
NuGrid/NuGridPy | nugridpy/mesa.py | _read_mesafile | def _read_mesafile(filename,data_rows=0,only='all'):
""" private routine that is not directly called by the user"""
f=open(filename,'r')
vv=[]
v=[]
lines = []
line = ''
for i in range(0,6):
line = f.readline()
lines.extend([line])
hval = lines[2].split()
hlist = li... | python | def _read_mesafile(filename,data_rows=0,only='all'):
""" private routine that is not directly called by the user"""
f=open(filename,'r')
vv=[]
v=[]
lines = []
line = ''
for i in range(0,6):
line = f.readline()
lines.extend([line])
hval = lines[2].split()
hlist = li... | [
"def",
"_read_mesafile",
"(",
"filename",
",",
"data_rows",
"=",
"0",
",",
"only",
"=",
"'all'",
")",
":",
"f",
"=",
"open",
"(",
"filename",
",",
"'r'",
")",
"vv",
"=",
"[",
"]",
"v",
"=",
"[",
"]",
"lines",
"=",
"[",
"]",
"line",
"=",
"''",
... | private routine that is not directly called by the user | [
"private",
"routine",
"that",
"is",
"not",
"directly",
"called",
"by",
"the",
"user"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L3725-L3774 |
NuGrid/NuGridPy | nugridpy/mesa.py | _cleanstarlog | def _cleanstarlog(file_in):
"""
cleaning history.data or star.log file, e.g. to take care of
repetitive restarts.
private, should not be called by user directly
Parameters
----------
file_in : string
Typically the filename of the mesa output history.data or
star.log file, c... | python | def _cleanstarlog(file_in):
"""
cleaning history.data or star.log file, e.g. to take care of
repetitive restarts.
private, should not be called by user directly
Parameters
----------
file_in : string
Typically the filename of the mesa output history.data or
star.log file, c... | [
"def",
"_cleanstarlog",
"(",
"file_in",
")",
":",
"file_out",
"=",
"file_in",
"+",
"'sa'",
"f",
"=",
"open",
"(",
"file_in",
")",
"lignes",
"=",
"f",
".",
"readlines",
"(",
")",
"f",
".",
"close",
"(",
")",
"nb",
"=",
"np",
".",
"array",
"(",
"["... | cleaning history.data or star.log file, e.g. to take care of
repetitive restarts.
private, should not be called by user directly
Parameters
----------
file_in : string
Typically the filename of the mesa output history.data or
star.log file, creates a clean file called history.datas... | [
"cleaning",
"history",
".",
"data",
"or",
"star",
".",
"log",
"file",
"e",
".",
"g",
".",
"to",
"take",
"care",
"of",
"repetitive",
"restarts",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L3777-L3820 |
NuGrid/NuGridPy | nugridpy/mesa.py | abu_profiles | def abu_profiles(p,ifig=1,xlm=xlm,ylm=(-8,0),show=False,abunds='All',xaxis=xaxis_type, figsize1=(8,8)):
'''Four panels of abundance plots
Parameters
----------
p : instance
mesa_profile instance
xlm : tuple
xlimits: mass_min, mass_max
abus : 'All' plots many 'commonly used'... | python | def abu_profiles(p,ifig=1,xlm=xlm,ylm=(-8,0),show=False,abunds='All',xaxis=xaxis_type, figsize1=(8,8)):
'''Four panels of abundance plots
Parameters
----------
p : instance
mesa_profile instance
xlm : tuple
xlimits: mass_min, mass_max
abus : 'All' plots many 'commonly used'... | [
"def",
"abu_profiles",
"(",
"p",
",",
"ifig",
"=",
"1",
",",
"xlm",
"=",
"xlm",
",",
"ylm",
"=",
"(",
"-",
"8",
",",
"0",
")",
",",
"show",
"=",
"False",
",",
"abunds",
"=",
"'All'",
",",
"xaxis",
"=",
"xaxis_type",
",",
"figsize1",
"=",
"(",
... | Four panels of abundance plots
Parameters
----------
p : instance
mesa_profile instance
xlm : tuple
xlimits: mass_min, mass_max
abus : 'All' plots many 'commonly used' isotopes up to Fe if they are in your mesa output.
otherwise provide a list of lists of desired abus
... | [
"Four",
"panels",
"of",
"abundance",
"plots"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L3827-L3944 |
NuGrid/NuGridPy | nugridpy/mesa.py | other_profiles | def other_profiles(p,ifig=1,xlm=xlm,show=False,xaxis=xaxis_type, figsize2=(10,8)):
'''Four panels of other profile plots
Parameters
----------
p : instance
mesa_profile instance
xll : tuple
xlimits: mass_min, mass_max
show : Boolean
False for batch use
True fo... | python | def other_profiles(p,ifig=1,xlm=xlm,show=False,xaxis=xaxis_type, figsize2=(10,8)):
'''Four panels of other profile plots
Parameters
----------
p : instance
mesa_profile instance
xll : tuple
xlimits: mass_min, mass_max
show : Boolean
False for batch use
True fo... | [
"def",
"other_profiles",
"(",
"p",
",",
"ifig",
"=",
"1",
",",
"xlm",
"=",
"xlm",
",",
"show",
"=",
"False",
",",
"xaxis",
"=",
"xaxis_type",
",",
"figsize2",
"=",
"(",
"10",
",",
"8",
")",
")",
":",
"matplotlib",
".",
"rc",
"(",
"'figure'",
",",... | Four panels of other profile plots
Parameters
----------
p : instance
mesa_profile instance
xll : tuple
xlimits: mass_min, mass_max
show : Boolean
False for batch use
True for interactive use | [
"Four",
"panels",
"of",
"other",
"profile",
"plots",
"Parameters",
"----------"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L3948-L4143 |
NuGrid/NuGridPy | nugridpy/mesa.py | mesa_profile._profiles_index | def _profiles_index(self):
"""
read profiles.index and make hash array
Notes
-----
sets the attributes.
log_ind : hash array that returns profile.data or log.data
file number from model number.
model : the models for which profile.data or log.data is
... | python | def _profiles_index(self):
"""
read profiles.index and make hash array
Notes
-----
sets the attributes.
log_ind : hash array that returns profile.data or log.data
file number from model number.
model : the models for which profile.data or log.data is
... | [
"def",
"_profiles_index",
"(",
"self",
")",
":",
"prof_ind_name",
"=",
"self",
".",
"prof_ind_name",
"f",
"=",
"open",
"(",
"self",
".",
"sldir",
"+",
"'/'",
"+",
"prof_ind_name",
",",
"'r'",
")",
"line",
"=",
"f",
".",
"readline",
"(",
")",
"numlines"... | read profiles.index and make hash array
Notes
-----
sets the attributes.
log_ind : hash array that returns profile.data or log.data
file number from model number.
model : the models for which profile.data or log.data is
available | [
"read",
"profiles",
".",
"index",
"and",
"make",
"hash",
"array"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L421-L455 |
NuGrid/NuGridPy | nugridpy/mesa.py | mesa_profile._log_file_ind | def _log_file_ind(self,inum):
"""
Information about available profile.data or log.data files.
Parameters
----------
inum : integer
Attempt to get number of inum's profile.data file.
inum_max: max number of profile.data or log.data files
availa... | python | def _log_file_ind(self,inum):
"""
Information about available profile.data or log.data files.
Parameters
----------
inum : integer
Attempt to get number of inum's profile.data file.
inum_max: max number of profile.data or log.data files
availa... | [
"def",
"_log_file_ind",
"(",
"self",
",",
"inum",
")",
":",
"self",
".",
"_profiles_index",
"(",
")",
"if",
"inum",
"<=",
"0",
":",
"print",
"(",
"\"Smallest argument is 1\"",
")",
"return",
"inum_max",
"=",
"len",
"(",
"self",
".",
"log_ind",
")",
"inum... | Information about available profile.data or log.data files.
Parameters
----------
inum : integer
Attempt to get number of inum's profile.data file.
inum_max: max number of profile.data or log.data files
available | [
"Information",
"about",
"available",
"profile",
".",
"data",
"or",
"log",
".",
"data",
"files",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L459-L488 |
NuGrid/NuGridPy | nugridpy/mesa.py | mesa_profile.get | def get(self,str_name):
"""
return a column of data with the name str_name.
Parameters
----------
str_name : string
Is the name of the column as printed in the
profilennn.data or lognnn.data file; get the available
columns from self.cols (wher... | python | def get(self,str_name):
"""
return a column of data with the name str_name.
Parameters
----------
str_name : string
Is the name of the column as printed in the
profilennn.data or lognnn.data file; get the available
columns from self.cols (wher... | [
"def",
"get",
"(",
"self",
",",
"str_name",
")",
":",
"column_array",
"=",
"self",
".",
"data",
"[",
":",
",",
"self",
".",
"cols",
"[",
"str_name",
"]",
"-",
"1",
"]",
".",
"astype",
"(",
"'float'",
")",
"return",
"column_array"
] | return a column of data with the name str_name.
Parameters
----------
str_name : string
Is the name of the column as printed in the
profilennn.data or lognnn.data file; get the available
columns from self.cols (where you replace self with the
name... | [
"return",
"a",
"column",
"of",
"data",
"with",
"the",
"name",
"str_name",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L490-L505 |
NuGrid/NuGridPy | nugridpy/mesa.py | mesa_profile.write_PROM_HOTB_progenitor | def write_PROM_HOTB_progenitor(self,name,description):
"""
Write a progenitor file for the PROMETHEUS/HBOT supernova code.
Parameters
----------
name : string
File name for the progenitor file
description : string
Information to be written into th... | python | def write_PROM_HOTB_progenitor(self,name,description):
"""
Write a progenitor file for the PROMETHEUS/HBOT supernova code.
Parameters
----------
name : string
File name for the progenitor file
description : string
Information to be written into th... | [
"def",
"write_PROM_HOTB_progenitor",
"(",
"self",
",",
"name",
",",
"description",
")",
":",
"try",
":",
"from",
"ProgenitorHotb_new",
"import",
"ProgenitorHotb_new",
"except",
"ImportError",
":",
"print",
"(",
"'Module ProgenitorHotb_new not found.'",
")",
"return",
... | Write a progenitor file for the PROMETHEUS/HBOT supernova code.
Parameters
----------
name : string
File name for the progenitor file
description : string
Information to be written into the file header. | [
"Write",
"a",
"progenitor",
"file",
"for",
"the",
"PROMETHEUS",
"/",
"HBOT",
"supernova",
"code",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L507-L550 |
NuGrid/NuGridPy | nugridpy/mesa.py | mesa_profile.write_STELLA_model | def write_STELLA_model(self,name):
"""
Write an initial model in a format that may easily be read by the
radiation hydrodynamics code STELLA.
Parameters
----------
name : string
an identifier for the model. There are two output files from
this met... | python | def write_STELLA_model(self,name):
"""
Write an initial model in a format that may easily be read by the
radiation hydrodynamics code STELLA.
Parameters
----------
name : string
an identifier for the model. There are two output files from
this met... | [
"def",
"write_STELLA_model",
"(",
"self",
",",
"name",
")",
":",
"# Hydro variables:",
"zn",
"=",
"np",
".",
"array",
"(",
"self",
".",
"get",
"(",
"'zone'",
")",
",",
"np",
".",
"int64",
")",
"Mr",
"=",
"self",
".",
"get",
"(",
"'mass'",
")",
"[",... | Write an initial model in a format that may easily be read by the
radiation hydrodynamics code STELLA.
Parameters
----------
name : string
an identifier for the model. There are two output files from
this method, which will be <name>.hyd and <name>.abn, which
... | [
"Write",
"an",
"initial",
"model",
"in",
"a",
"format",
"that",
"may",
"easily",
"be",
"read",
"by",
"the",
"radiation",
"hydrodynamics",
"code",
"STELLA",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L552-L690 |
NuGrid/NuGridPy | nugridpy/mesa.py | mesa_profile.write_LEAFS_model | def write_LEAFS_model(self,nzn=30000000,dr=5.e4,
rhostrip=5.e-4):
"""
write an ascii file that will be read by Sam's version of
inimod.F90 in order to make an initial model for LEAFS
"""
from scipy import interpolate
ye = self.get('ye')
... | python | def write_LEAFS_model(self,nzn=30000000,dr=5.e4,
rhostrip=5.e-4):
"""
write an ascii file that will be read by Sam's version of
inimod.F90 in order to make an initial model for LEAFS
"""
from scipy import interpolate
ye = self.get('ye')
... | [
"def",
"write_LEAFS_model",
"(",
"self",
",",
"nzn",
"=",
"30000000",
",",
"dr",
"=",
"5.e4",
",",
"rhostrip",
"=",
"5.e-4",
")",
":",
"from",
"scipy",
"import",
"interpolate",
"ye",
"=",
"self",
".",
"get",
"(",
"'ye'",
")",
"newye",
"=",
"[",
"]",
... | write an ascii file that will be read by Sam's version of
inimod.F90 in order to make an initial model for LEAFS | [
"write",
"an",
"ascii",
"file",
"that",
"will",
"be",
"read",
"by",
"Sam",
"s",
"version",
"of",
"inimod",
".",
"F90",
"in",
"order",
"to",
"make",
"an",
"initial",
"model",
"for",
"LEAFS"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L692-L744 |
NuGrid/NuGridPy | nugridpy/mesa.py | mesa_profile.energy_profile | def energy_profile(self,ixaxis):
"""
Plot radial profile of key energy generations eps_nuc,
eps_neu etc.
Parameters
----------
ixaxis : 'mass' or 'radius'
"""
mass = self.get('mass')
radius = self.get('radius') * ast.rsun_cm
... | python | def energy_profile(self,ixaxis):
"""
Plot radial profile of key energy generations eps_nuc,
eps_neu etc.
Parameters
----------
ixaxis : 'mass' or 'radius'
"""
mass = self.get('mass')
radius = self.get('radius') * ast.rsun_cm
... | [
"def",
"energy_profile",
"(",
"self",
",",
"ixaxis",
")",
":",
"mass",
"=",
"self",
".",
"get",
"(",
"'mass'",
")",
"radius",
"=",
"self",
".",
"get",
"(",
"'radius'",
")",
"*",
"ast",
".",
"rsun_cm",
"eps_nuc",
"=",
"self",
".",
"get",
"(",
"'eps_... | Plot radial profile of key energy generations eps_nuc,
eps_neu etc.
Parameters
----------
ixaxis : 'mass' or 'radius' | [
"Plot",
"radial",
"profile",
"of",
"key",
"energy",
"generations",
"eps_nuc",
"eps_neu",
"etc",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L746-L780 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data._read_starlog | def _read_starlog(self):
""" read history.data or star.log file again"""
sldir = self.sldir
slname = self.slname
slaname = slname+'sa'
if not os.path.exists(sldir+'/'+slaname):
print('No '+self.slname+'sa file found, create new one from '+self.slname)
... | python | def _read_starlog(self):
""" read history.data or star.log file again"""
sldir = self.sldir
slname = self.slname
slaname = slname+'sa'
if not os.path.exists(sldir+'/'+slaname):
print('No '+self.slname+'sa file found, create new one from '+self.slname)
... | [
"def",
"_read_starlog",
"(",
"self",
")",
":",
"sldir",
"=",
"self",
".",
"sldir",
"slname",
"=",
"self",
".",
"slname",
"slaname",
"=",
"slname",
"+",
"'sa'",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"sldir",
"+",
"'/'",
"+",
"slaname",
... | read history.data or star.log file again | [
"read",
"history",
".",
"data",
"or",
"star",
".",
"log",
"file",
"again"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L898-L926 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.CO_ratio | def CO_ratio(self,ifig,ixaxis):
"""
plot surface C/O ratio in Figure ifig with x-axis quantity ixaxis
Parameters
----------
ifig : integer
Figure number in which to plot
ixaxis : string
what quantity is to be on the x-axis, either 'time' or 'model... | python | def CO_ratio(self,ifig,ixaxis):
"""
plot surface C/O ratio in Figure ifig with x-axis quantity ixaxis
Parameters
----------
ifig : integer
Figure number in which to plot
ixaxis : string
what quantity is to be on the x-axis, either 'time' or 'model... | [
"def",
"CO_ratio",
"(",
"self",
",",
"ifig",
",",
"ixaxis",
")",
":",
"def",
"C_O",
"(",
"model",
")",
":",
"surface_c12",
"=",
"model",
".",
"get",
"(",
"'surface_c12'",
")",
"surface_o16",
"=",
"model",
".",
"get",
"(",
"'surface_o16'",
")",
"CORatio... | plot surface C/O ratio in Figure ifig with x-axis quantity ixaxis
Parameters
----------
ifig : integer
Figure number in which to plot
ixaxis : string
what quantity is to be on the x-axis, either 'time' or 'model'
The default is 'model' | [
"plot",
"surface",
"C",
"/",
"O",
"ratio",
"in",
"Figure",
"ifig",
"with",
"x",
"-",
"axis",
"quantity",
"ixaxis"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L944-L971 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.hrd | def hrd(self,ifig=None,label=None,colour=None,s2ms=False,
dashes=None,**kwargs):
"""
Plot an HR diagram
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The default value is None.
lims : l... | python | def hrd(self,ifig=None,label=None,colour=None,s2ms=False,
dashes=None,**kwargs):
"""
Plot an HR diagram
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The default value is None.
lims : l... | [
"def",
"hrd",
"(",
"self",
",",
"ifig",
"=",
"None",
",",
"label",
"=",
"None",
",",
"colour",
"=",
"None",
",",
"s2ms",
"=",
"False",
",",
"dashes",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# fsize=18",
"#",
"# params = {'axes.la... | Plot an HR diagram
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The default value is None.
lims : list [x_lower, x_upper, y_lower, y_upper]
label : string
Label for the model
The d... | [
"Plot",
"an",
"HR",
"diagram"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L973-L1056 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.hrd_key | def hrd_key(self, key_str):
"""
plot an HR diagram
Parameters
----------
key_str : string
A label string
"""
pyl.plot(self.data[:,self.cols['log_Teff']-1],\
self.data[:,self.cols['log_L']-1],label = key_str)
pyl.legend()
... | python | def hrd_key(self, key_str):
"""
plot an HR diagram
Parameters
----------
key_str : string
A label string
"""
pyl.plot(self.data[:,self.cols['log_Teff']-1],\
self.data[:,self.cols['log_L']-1],label = key_str)
pyl.legend()
... | [
"def",
"hrd_key",
"(",
"self",
",",
"key_str",
")",
":",
"pyl",
".",
"plot",
"(",
"self",
".",
"data",
"[",
":",
",",
"self",
".",
"cols",
"[",
"'log_Teff'",
"]",
"-",
"1",
"]",
",",
"self",
".",
"data",
"[",
":",
",",
"self",
".",
"cols",
"[... | plot an HR diagram
Parameters
----------
key_str : string
A label string | [
"plot",
"an",
"HR",
"diagram"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1059-L1077 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.hrd_new | def hrd_new(self, input_label="", skip=0):
"""
plot an HR diagram with options to skip the first N lines and
add a label string
Parameters
----------
input_label : string, optional
Diagram label. The default is "".
skip : integer, optional
... | python | def hrd_new(self, input_label="", skip=0):
"""
plot an HR diagram with options to skip the first N lines and
add a label string
Parameters
----------
input_label : string, optional
Diagram label. The default is "".
skip : integer, optional
... | [
"def",
"hrd_new",
"(",
"self",
",",
"input_label",
"=",
"\"\"",
",",
"skip",
"=",
"0",
")",
":",
"xl_old",
"=",
"pyl",
".",
"gca",
"(",
")",
".",
"get_xlim",
"(",
")",
"if",
"input_label",
"==",
"\"\"",
":",
"my_label",
"=",
"\"M=\"",
"+",
"str",
... | plot an HR diagram with options to skip the first N lines and
add a label string
Parameters
----------
input_label : string, optional
Diagram label. The default is "".
skip : integer, optional
Skip the first n lines. The default is 0. | [
"plot",
"an",
"HR",
"diagram",
"with",
"options",
"to",
"skip",
"the",
"first",
"N",
"lines",
"and",
"add",
"a",
"label",
"string"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1079-L1108 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.xche4_teff | def xche4_teff(self,ifig=None,lims=[1.,0.,3.4,4.7],label=None,colour=None,
s2ms=True,dashes=None):
"""
Plot effective temperature against central helium abundance.
Parameters
----------
ifig : integer or string
Figure label, if None the current fig... | python | def xche4_teff(self,ifig=None,lims=[1.,0.,3.4,4.7],label=None,colour=None,
s2ms=True,dashes=None):
"""
Plot effective temperature against central helium abundance.
Parameters
----------
ifig : integer or string
Figure label, if None the current fig... | [
"def",
"xche4_teff",
"(",
"self",
",",
"ifig",
"=",
"None",
",",
"lims",
"=",
"[",
"1.",
",",
"0.",
",",
"3.4",
",",
"4.7",
"]",
",",
"label",
"=",
"None",
",",
"colour",
"=",
"None",
",",
"s2ms",
"=",
"True",
",",
"dashes",
"=",
"None",
")",
... | Plot effective temperature against central helium abundance.
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The default value is None.
lims : list [x_lower, x_upper, y_lower, y_upper]
label : string
... | [
"Plot",
"effective",
"temperature",
"against",
"central",
"helium",
"abundance",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1110-L1184 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.tcrhoc | def tcrhoc(self,ifig=None,lims=[3.,10.,8.,10.],label=None,colour=None,
dashes=None):
"""
Central temperature again central density plot
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The defa... | python | def tcrhoc(self,ifig=None,lims=[3.,10.,8.,10.],label=None,colour=None,
dashes=None):
"""
Central temperature again central density plot
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The defa... | [
"def",
"tcrhoc",
"(",
"self",
",",
"ifig",
"=",
"None",
",",
"lims",
"=",
"[",
"3.",
",",
"10.",
",",
"8.",
",",
"10.",
"]",
",",
"label",
"=",
"None",
",",
"colour",
"=",
"None",
",",
"dashes",
"=",
"None",
")",
":",
"# fsize=18",
"#",
... | Central temperature again central density plot
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The default value is None.
lims : list [x_lower, x_upper, y_lower, y_upper]
label : string
Label for... | [
"Central",
"temperature",
"again",
"central",
"density",
"plot"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1187-L1251 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.mdot_t | def mdot_t(self,ifig=None,lims=[7.4,2.6,-8.5,-4.5],label=None,colour=None,s2ms=False,
dashes=None):
"""
Plot mass loss history as a function of log-time-left
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is use... | python | def mdot_t(self,ifig=None,lims=[7.4,2.6,-8.5,-4.5],label=None,colour=None,s2ms=False,
dashes=None):
"""
Plot mass loss history as a function of log-time-left
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is use... | [
"def",
"mdot_t",
"(",
"self",
",",
"ifig",
"=",
"None",
",",
"lims",
"=",
"[",
"7.4",
",",
"2.6",
",",
"-",
"8.5",
",",
"-",
"4.5",
"]",
",",
"label",
"=",
"None",
",",
"colour",
"=",
"None",
",",
"s2ms",
"=",
"False",
",",
"dashes",
"=",
"No... | Plot mass loss history as a function of log-time-left
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The default value is None.
lims : list [x_lower, x_upper, y_lower, y_upper]
label : string
La... | [
"Plot",
"mass",
"loss",
"history",
"as",
"a",
"function",
"of",
"log",
"-",
"time",
"-",
"left"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1253-L1337 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.mcc_t | def mcc_t(self,ifig=None,lims=[0,15,0,25],label=None,colour=None,
mask=False,s2ms=False,dashes=None):
"""
Plot mass of [oclark01@scandium 15M_led_f_print_nets]$ cp ../15M_led_f_ppcno/ective core as a function of time.
Parameters
----------
ifig : integer or string
... | python | def mcc_t(self,ifig=None,lims=[0,15,0,25],label=None,colour=None,
mask=False,s2ms=False,dashes=None):
"""
Plot mass of [oclark01@scandium 15M_led_f_print_nets]$ cp ../15M_led_f_ppcno/ective core as a function of time.
Parameters
----------
ifig : integer or string
... | [
"def",
"mcc_t",
"(",
"self",
",",
"ifig",
"=",
"None",
",",
"lims",
"=",
"[",
"0",
",",
"15",
",",
"0",
",",
"25",
"]",
",",
"label",
"=",
"None",
",",
"colour",
"=",
"None",
",",
"mask",
"=",
"False",
",",
"s2ms",
"=",
"False",
",",
"dashes"... | Plot mass of [oclark01@scandium 15M_led_f_print_nets]$ cp ../15M_led_f_ppcno/ective core as a function of time.
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is used
The default value is None.
lims : list [x_lower, x_uppe... | [
"Plot",
"mass",
"of",
"[",
"oclark01@scandium",
"15M_led_f_print_nets",
"]",
"$",
"cp",
"..",
"/",
"15M_led_f_ppcno",
"/",
"ective",
"core",
"as",
"a",
"function",
"of",
"time",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1339-L1443 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.kippenhahn_CO | def kippenhahn_CO(self, num_frame, xax, t0_model=0,
title='Kippenhahn diagram', tp_agb=0.,
ylim_CO=[0,0]):
"""
Kippenhahn plot as a function of time or model with CO ratio
Parameters
----------
num_frame : integer
Number of... | python | def kippenhahn_CO(self, num_frame, xax, t0_model=0,
title='Kippenhahn diagram', tp_agb=0.,
ylim_CO=[0,0]):
"""
Kippenhahn plot as a function of time or model with CO ratio
Parameters
----------
num_frame : integer
Number of... | [
"def",
"kippenhahn_CO",
"(",
"self",
",",
"num_frame",
",",
"xax",
",",
"t0_model",
"=",
"0",
",",
"title",
"=",
"'Kippenhahn diagram'",
",",
"tp_agb",
"=",
"0.",
",",
"ylim_CO",
"=",
"[",
"0",
",",
"0",
"]",
")",
":",
"pyl",
".",
"figure",
"(",
"n... | Kippenhahn plot as a function of time or model with CO ratio
Parameters
----------
num_frame : integer
Number of frame to plot this plot into.
xax : string
Either model or time to indicate what is to be used on the
x-axis.
t0_model : integer, ... | [
"Kippenhahn",
"plot",
"as",
"a",
"function",
"of",
"time",
"or",
"model",
"with",
"CO",
"ratio"
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1446-L1536 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.kippenhahn | def kippenhahn(self, num_frame, xax, t0_model=0,
title='Kippenhahn diagram', tp_agb=0., t_eps=5.e2,
plot_star_mass=True, symbol_size=8, c12_bm=False,
print_legend=True):
"""Kippenhahn plot as a function of time or model.
Parameters
------... | python | def kippenhahn(self, num_frame, xax, t0_model=0,
title='Kippenhahn diagram', tp_agb=0., t_eps=5.e2,
plot_star_mass=True, symbol_size=8, c12_bm=False,
print_legend=True):
"""Kippenhahn plot as a function of time or model.
Parameters
------... | [
"def",
"kippenhahn",
"(",
"self",
",",
"num_frame",
",",
"xax",
",",
"t0_model",
"=",
"0",
",",
"title",
"=",
"'Kippenhahn diagram'",
",",
"tp_agb",
"=",
"0.",
",",
"t_eps",
"=",
"5.e2",
",",
"plot_star_mass",
"=",
"True",
",",
"symbol_size",
"=",
"8",
... | Kippenhahn plot as a function of time or model.
Parameters
----------
num_frame : integer
Number of frame to plot this plot into, if <0 open no new
figure.
xax : string
Either 'model', 'time' or 'logtimerev' to indicate what is
to be used ... | [
"Kippenhahn",
"plot",
"as",
"a",
"function",
"of",
"time",
"or",
"model",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1538-L1658 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.t_surfabu | def t_surfabu(self, num_frame, xax, t0_model=0,
title='surface abundance', t_eps=1.e-3,
plot_CO_ratio=False):
"""
t_surfabu plots surface abundance evolution as a function of
time.
Parameters
----------
num_frame : integer
... | python | def t_surfabu(self, num_frame, xax, t0_model=0,
title='surface abundance', t_eps=1.e-3,
plot_CO_ratio=False):
"""
t_surfabu plots surface abundance evolution as a function of
time.
Parameters
----------
num_frame : integer
... | [
"def",
"t_surfabu",
"(",
"self",
",",
"num_frame",
",",
"xax",
",",
"t0_model",
"=",
"0",
",",
"title",
"=",
"'surface abundance'",
",",
"t_eps",
"=",
"1.e-3",
",",
"plot_CO_ratio",
"=",
"False",
")",
":",
"if",
"num_frame",
">=",
"0",
":",
"pyl",
".",... | t_surfabu plots surface abundance evolution as a function of
time.
Parameters
----------
num_frame : integer
Number of frame to plot this plot into, if <0 don't open
figure.
xax : string
Either model, time or logrevtime to indicate what is to ... | [
"t_surfabu",
"plots",
"surface",
"abundance",
"evolution",
"as",
"a",
"function",
"of",
"time",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1660-L1742 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.t_lumi | def t_lumi(self,num_frame,xax):
"""
Luminosity evolution as a function of time or model.
Parameters
----------
num_frame : integer
Number of frame to plot this plot into.
xax : string
Either model or time to indicate what is to be used on the
... | python | def t_lumi(self,num_frame,xax):
"""
Luminosity evolution as a function of time or model.
Parameters
----------
num_frame : integer
Number of frame to plot this plot into.
xax : string
Either model or time to indicate what is to be used on the
... | [
"def",
"t_lumi",
"(",
"self",
",",
"num_frame",
",",
"xax",
")",
":",
"pyl",
".",
"figure",
"(",
"num_frame",
")",
"if",
"xax",
"==",
"'time'",
":",
"xaxisarray",
"=",
"self",
".",
"get",
"(",
"'star_age'",
")",
"elif",
"xax",
"==",
"'model'",
":",
... | Luminosity evolution as a function of time or model.
Parameters
----------
num_frame : integer
Number of frame to plot this plot into.
xax : string
Either model or time to indicate what is to be used on the
x-axis | [
"Luminosity",
"evolution",
"as",
"a",
"function",
"of",
"time",
"or",
"model",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1747-L1783 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.t_surf_parameter | def t_surf_parameter(self, num_frame, xax):
"""
Surface parameter evolution as a function of time or model.
Parameters
----------
num_frame : integer
Number of frame to plot this plot into.
xax : string
Either model or time to indicate what is to ... | python | def t_surf_parameter(self, num_frame, xax):
"""
Surface parameter evolution as a function of time or model.
Parameters
----------
num_frame : integer
Number of frame to plot this plot into.
xax : string
Either model or time to indicate what is to ... | [
"def",
"t_surf_parameter",
"(",
"self",
",",
"num_frame",
",",
"xax",
")",
":",
"pyl",
".",
"figure",
"(",
"num_frame",
")",
"if",
"xax",
"==",
"'time'",
":",
"xaxisarray",
"=",
"self",
".",
"get",
"(",
"'star_age'",
")",
"elif",
"xax",
"==",
"'model'"... | Surface parameter evolution as a function of time or model.
Parameters
----------
num_frame : integer
Number of frame to plot this plot into.
xax : string
Either model or time to indicate what is to be used on the
x-axis | [
"Surface",
"parameter",
"evolution",
"as",
"a",
"function",
"of",
"time",
"or",
"model",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1785-L1821 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data._kip_vline | def _kip_vline(self, modstart, modstop, sparse, outfile,
xlims=[0.,0.], ylims=[0.,0.], ixaxis='log_time_left',
mix_zones=5, burn_zones=50):
"""
*** DEPRECIATED and hence UNSUPPORTED ***
This function creates a Kippenhahn plot with energy flux using
ver... | python | def _kip_vline(self, modstart, modstop, sparse, outfile,
xlims=[0.,0.], ylims=[0.,0.], ixaxis='log_time_left',
mix_zones=5, burn_zones=50):
"""
*** DEPRECIATED and hence UNSUPPORTED ***
This function creates a Kippenhahn plot with energy flux using
ver... | [
"def",
"_kip_vline",
"(",
"self",
",",
"modstart",
",",
"modstop",
",",
"sparse",
",",
"outfile",
",",
"xlims",
"=",
"[",
"0.",
",",
"0.",
"]",
",",
"ylims",
"=",
"[",
"0.",
",",
"0.",
"]",
",",
"ixaxis",
"=",
"'log_time_left'",
",",
"mix_zones",
"... | *** DEPRECIATED and hence UNSUPPORTED ***
This function creates a Kippenhahn plot with energy flux using
vertical lines, better thermal pulse resolution.
For a more comprehensive plot, your history.data or star.log
file should contain columns called "mix_type_n", "mix_qtop_n",
"... | [
"***",
"DEPRECIATED",
"and",
"hence",
"UNSUPPORTED",
"***",
"This",
"function",
"creates",
"a",
"Kippenhahn",
"plot",
"with",
"energy",
"flux",
"using",
"vertical",
"lines",
"better",
"thermal",
"pulse",
"resolution",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L1823-L2068 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.kip_cont | def kip_cont(self, ifig=110, modstart=0, modstop=-1,t0_model=0,
outfile='out.png', xlims=None, ylims=None,
xres=1000, yres=1000, ixaxis='model_number',
mix_zones=20, burn_zones=20, plot_radius=False,
engenPlus=True, engenMinus=False,
l... | python | def kip_cont(self, ifig=110, modstart=0, modstop=-1,t0_model=0,
outfile='out.png', xlims=None, ylims=None,
xres=1000, yres=1000, ixaxis='model_number',
mix_zones=20, burn_zones=20, plot_radius=False,
engenPlus=True, engenMinus=False,
l... | [
"def",
"kip_cont",
"(",
"self",
",",
"ifig",
"=",
"110",
",",
"modstart",
"=",
"0",
",",
"modstop",
"=",
"-",
"1",
",",
"t0_model",
"=",
"0",
",",
"outfile",
"=",
"'out.png'",
",",
"xlims",
"=",
"None",
",",
"ylims",
"=",
"None",
",",
"xres",
"="... | This function creates a Kippenhahn plot with energy flux using
contours.
This plot uses mixing_regions and burning_regions written to
your history.data or star.log. Set both variables in the
log_columns.list file to 20 as a start.
The output log file should then contain columns... | [
"This",
"function",
"creates",
"a",
"Kippenhahn",
"plot",
"with",
"energy",
"flux",
"using",
"contours",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L2070-L2600 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.find_first_TP | def find_first_TP(self):
"""
Find first TP of the TPAGB phase and returns the model
number at its LHe maximum.
Parameters
----------
"""
star_mass = self.get('star_mass')
he_lumi = self.get('log_LHe')
h_lumi = self.... | python | def find_first_TP(self):
"""
Find first TP of the TPAGB phase and returns the model
number at its LHe maximum.
Parameters
----------
"""
star_mass = self.get('star_mass')
he_lumi = self.get('log_LHe')
h_lumi = self.... | [
"def",
"find_first_TP",
"(",
"self",
")",
":",
"star_mass",
"=",
"self",
".",
"get",
"(",
"'star_mass'",
")",
"he_lumi",
"=",
"self",
".",
"get",
"(",
"'log_LHe'",
")",
"h_lumi",
"=",
"self",
".",
"get",
"(",
"'log_LH'",
")",
"mx2_bot",
"=",
"self",
... | Find first TP of the TPAGB phase and returns the model
number at its LHe maximum.
Parameters
---------- | [
"Find",
"first",
"TP",
"of",
"the",
"TPAGB",
"phase",
"and",
"returns",
"the",
"model",
"number",
"at",
"its",
"LHe",
"maximum",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L3150-L3201 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.find_TPs_and_DUPs | def find_TPs_and_DUPs(self, percent=5., makefig=False):
"""
Function which finds TPs and uses the calc_DUP_parameter
function. To calculate DUP parameter evolution dependent of
the star or core mass.
Parameters
----------
fig : integer
Figure number ... | python | def find_TPs_and_DUPs(self, percent=5., makefig=False):
"""
Function which finds TPs and uses the calc_DUP_parameter
function. To calculate DUP parameter evolution dependent of
the star or core mass.
Parameters
----------
fig : integer
Figure number ... | [
"def",
"find_TPs_and_DUPs",
"(",
"self",
",",
"percent",
"=",
"5.",
",",
"makefig",
"=",
"False",
")",
":",
"t0_model",
"=",
"self",
".",
"find_first_TP",
"(",
")",
"t0_idx",
"=",
"(",
"t0_model",
"-",
"self",
".",
"get",
"(",
"\"model_number\"",
")",
... | Function which finds TPs and uses the calc_DUP_parameter
function. To calculate DUP parameter evolution dependent of
the star or core mass.
Parameters
----------
fig : integer
Figure number to plot.
t0_model : integer
First he-shell lum peak.
... | [
"Function",
"which",
"finds",
"TPs",
"and",
"uses",
"the",
"calc_DUP_parameter",
"function",
".",
"To",
"calculate",
"DUP",
"parameter",
"evolution",
"dependent",
"of",
"the",
"star",
"or",
"core",
"mass",
"."
] | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L3204-L3310 |
NuGrid/NuGridPy | nugridpy/mesa.py | history_data.TPAGB_properties | def TPAGB_properties(self):
"""
Temporary, use for now same function in nugrid_set.py!
Returns many TPAGB parameters which are
TPstart,TPmods,TP_max_env,TPend,min_m_TP,max_m_TP,DUPmods,DUPm_min_h
Same function in nugrid_set.py.
Parameters
----------
"""... | python | def TPAGB_properties(self):
"""
Temporary, use for now same function in nugrid_set.py!
Returns many TPAGB parameters which are
TPstart,TPmods,TP_max_env,TPend,min_m_TP,max_m_TP,DUPmods,DUPm_min_h
Same function in nugrid_set.py.
Parameters
----------
"""... | [
"def",
"TPAGB_properties",
"(",
"self",
")",
":",
"peak_lum_model",
",",
"h1_mass_min_DUP_model",
"=",
"self",
".",
"find_TP_attributes",
"(",
"3",
",",
"t0_model",
"=",
"self",
".",
"find_first_TP",
"(",
")",
",",
"color",
"=",
"'r'",
",",
"marker_type",
"=... | Temporary, use for now same function in nugrid_set.py!
Returns many TPAGB parameters which are
TPstart,TPmods,TP_max_env,TPend,min_m_TP,max_m_TP,DUPmods,DUPm_min_h
Same function in nugrid_set.py.
Parameters
---------- | [
"Temporary",
"use",
"for",
"now",
"same",
"function",
"in",
"nugrid_set",
".",
"py!",
"Returns",
"many",
"TPAGB",
"parameters",
"which",
"are",
"TPstart",
"TPmods",
"TP_max_env",
"TPend",
"min_m_TP",
"max_m_TP",
"DUPmods",
"DUPm_min_h",
"Same",
"function",
"in",
... | train | https://github.com/NuGrid/NuGridPy/blob/eee8047446e398be77362d82c1d8b3310054fab0/nugridpy/mesa.py#L3312-L3464 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.