index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
46,677 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/_python_reference/network.py | import numba
import numpy as np
from numba.experimental import jitclass
from pynucastro.rates import TableIndex, TableInterpolator, TabularRate, Tfactors
from pynucastro.screening import PlasmaState, ScreenFactors
jn = 0
jp = 1
jhe4 = 2
jc12 = 3
jo16 = 4
jne20 = 5
jne23 = 6
jna23 = 7
jmg23 = 8
nnuc = 9
A = np.zeros(... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,678 | pynucastro/pynucastro | refs/heads/main | /pynucastro/reduction/reduction_utils.py | class MPIImportError(Exception):
pass
class FailedMPIImport:
"""Class that can replace an mpi4py.MPI import and will throw an error if used."""
def __init__(self, error=None, msg=None):
self.error_obj = error
if msg is None:
msg = ("Failed to import MPI from mpi4py. Check yo... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,679 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_screening.py | import pytest
from pytest import approx
from pynucastro import networks
from pynucastro.screening import chugunov_2007, chugunov_2009
class TestScreening:
@pytest.fixture(scope="class")
def rc(self):
files = ["c12-ag-o16-nac2",
"c12-c12a-ne20-cf88",
"c12-c12n-mg23-cf... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,680 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/PartitionFunction/convert_rathpf_2000.py | #!/usr/bin/env python
"""
Reformat the partition function tables retrieved from https://download.nucastro.org/astro/fits/
into a standard format for pynucastro.
The tables part_frdm.asc and part_etfsiq.asc corresponds to:
Thomas Rauscher and Friedrich-Karl Thielemann, Atomic Data and Nuclear
Data Tables, 75:1–351, 20... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,681 | pynucastro/pynucastro | refs/heads/main | /examples/CNO_cython/setup.py | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
ext = Extension("cno_rhs", ["cno_rhs.pyx"],
include_dirs = [numpy.get_include()])
setup(ext_modules=[ext],
cmdclass = {'build_ext': build_ext})
| {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,682 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/AtomicMassEvaluation/ame_nuclide.py | class AMENuclide(object):
"""Hold the information for a single nucleus from the AME
database."""
def __init__(self, n=None, z=None, a=None, element=None, origin=None,
mexcess=None, d_mexcess=None, nucbind=None,
d_nucbind=None, decay_type=None, ebeta=None,
d... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,683 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_python_net2.py | # unit tests for rates
import pytest
import pynucastro as pyna
class TestPythonNetwork2:
@pytest.fixture(scope="class")
def pynet(self, reaclib_library):
mylib = reaclib_library.linking_nuclei(["he4", "c12", "o16"])
return pyna.PythonNetwork(libraries=[mylib], inert_nuclei=["ne20"])
def ... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,684 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_approx_screening.py | # unit tests for screening with approximate rates
# we'll test both symmetric and "normal" screening
import pytest
import pynucastro as pyna
class TestApproxScreening:
@pytest.fixture(scope="class")
def mynet(self, reaclib_library):
return reaclib_library.linking_nuclei(["p", "he4", "mg24",
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,685 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/python_network.py | """Support modules to write a pure python reaction network ODE
source"""
import os
import shutil
import sys
from pynucastro.networks.rate_collection import RateCollection
from pynucastro.rates.rate import ApproximateRate
class PythonNetwork(RateCollection):
"""A pure python reaction network."""
def full_yd... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,686 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/mass_table.py | import os
class MassTable:
"""
The purpose of this class is to:
a) Create a dictionary mapping nuclides to their mass excess A_nuc - A measured
in MeV from the table mass_excess2020.txt.
b) Parse the information of the previously defined dictionary to the Nucleus
class.
The only r... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,687 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/tests/test_library_rates_by_name.py | # unit tests for rates
class TestGetRatesByName:
def test_reaclib_rates(self, reaclib_library):
r1 = "c12(a,g)o16"
r2 = "c12(c12,a)ne20"
r3 = "a(aa,g)c12"
r4 = "f20(e,nu)o20" # not found in ReacLib
r5 = "f20(,e)ne20"
assert reaclib_library.get_rate_by_name(r1).... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,688 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/library.py | import collections
import io
import os
import re
from pynucastro.nucdata import Nucleus, UnsupportedNucleus
from pynucastro.rates.rate import (DerivedRate, Rate, RateFileError,
ReacLibRate, TabularRate, _find_rate_file,
get_rates_dir, load_rate)
d... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,689 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/tests/test_library.py | # unit tests for rates
import pynucastro as pyna
class TestLibrary:
@classmethod
def setup_class(cls):
""" this is run once for each class before any tests """
@classmethod
def teardown_class(cls):
""" this is run once for each class after all tests """
def setup_method(self):
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,690 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/__init__.py | """Properties of nuclei needed in construction reaction rates (in
particular, the binding energies)
"""
#__all__ = [binding_nuclide, binding_table, elements, partition_function]
from .binding_table import BindingTable
from .elements import Element, PeriodicTable, UnidentifiedElement
from .mass_table import MassTable... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,691 | pynucastro/pynucastro | refs/heads/main | /pynucastro/library/tabular/suzuki/checktables.py | #!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("infile", type=str)
parser.add_argument("-p", action="store_true", help="print stuff for checking which rate is which")
args = parser.parse_args()
table_file = None
header_lines = None
def nuc_A_first(nuc_A_last):
snu... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,692 | pynucastro/pynucastro | refs/heads/main | /logo/logo_base.py | import pynucastro as pyna
files = ["c12-pg-n13-ls09",
"c13-pg-n14-nacr",
"n13--c13-wc12",
"n13-pg-o14-lg06",
"n14-pg-o15-im05",
"n15-pa-c12-nacr",
"o14--n14-wc12",
"o15--n15-wc12",
"o14-ap-f17-Ha96c",
"f17-pg-ne18-cb09",
"ne18--f... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,693 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/binding_table.py | """
Reads tabular binding energy/nucleon data file and supplies table data.
"""
# Common Imports
import os
class BindingTable:
"""A simple class to manage reading and parsing the table of binding energy/nucleon."""
header_length = 2
def __init__(self, datfile=None):
"""
Initialize
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,694 | pynucastro/pynucastro | refs/heads/main | /examples/triple-alpha/triple-alpha.py | # triple-alpha rate module generator
from pynucastro.networks import PythonNetwork
files = ["c12-gaa-he4-fy05",
"he4-aag-c12-fy05"]
triple_alpha_net = PythonNetwork(files)
triple_alpha_net.write_network("triple-alpha_rhs.py")
| {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,695 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_full_python_net.py | import os
import shutil
import numpy as np
import pytest
from numpy.testing import assert_allclose
from pynucastro import networks
class TestFullPythonNetwork:
@pytest.fixture(scope="class")
def fn(self):
files = ["c12-c12a-ne20-cf88",
"c12-c12n-mg23-cf88",
"c12-c12... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,696 | pynucastro/pynucastro | refs/heads/main | /examples/rp-process/rp_process.py | #!/usr/bin/env python3
import sys
import argparse
from collections import deque
from pynucastro.rates import Library, RateFilter
from pynucastro.nucdata import Nucleus, BindingTable
from pynucastro.networks import PythonNetwork, Composition
#################################################
# Set up argument parser ... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,697 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/tests/conftest.py | # reuse fixture from networks/tests
# pylint: disable=unused-import
from pynucastro.networks.tests.conftest import reaclib_library # noqa: F401
from pynucastro.networks.tests.conftest import tabular_library # noqa: F401
| {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,698 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/base_cxx_network.py | """Support for a pure C++ reaction network. These functions will
write the C++ code necessary to integrate a reaction network
comprised of the rates that are passed in.
"""
import itertools
import os
import re
import shutil
import sys
from abc import ABC, abstractmethod
import numpy as np
import sympy
from pynuca... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,699 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/conftest.py | import pytest
import pynucastro as pyna
# enable assert rewriting for the helper functions in ./helpers.py
pytest.register_assert_rewrite('pynucastro.networks.tests.helpers')
@pytest.fixture(scope="package")
def reaclib_library():
return pyna.ReacLibLibrary()
@pytest.fixture(scope="package")
def tabular_libra... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,700 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/tests/test_ratefilter.py | # unit tests for rates
import pytest
import pynucastro as pyna
class TestRateFilter:
@pytest.fixture(scope="class")
def library(self):
""" this is run before each test """
files = ["c12-pg-n13-ls09",
"c13-pg-n14-nacr",
"n13-pg-o14-lg06",
"n... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,701 | pynucastro/pynucastro | refs/heads/main | /pynucastro/screening/tests/test_screen.py | import pytest
from pytest import approx
import pynucastro as pyna
from pynucastro.screening import (chugunov_2007, chugunov_2009,
make_plasma_state, make_screen_factors,
potekhin_1998)
class TestScreen:
@pytest.fixture(scope="class")
def nuc... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,702 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/tests/test_partition.py | import os
from numpy import array
from pynucastro.nucdata import (PartitionFunctionCollection,
PartitionFunctionTable)
nucdata_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
pf_dir = os.path.join(nucdata_dir, 'PartitionFunction')
dir_etfsiq_low = os.path.join(pf_d... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,703 | pynucastro/pynucastro | refs/heads/main | /pynucastro/screening/screen.py | """
Python implementations of screening routines.
"""
import numpy as np
from scipy import constants
# use the jitclass placeholder from rate.py
from pynucastro.rates.rate import jitclass, numba
if numba is not None:
njit = numba.njit
else:
def njit(func):
return func
__all__ = ["PlasmaState", "Scree... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,704 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/simple_cxx_network.py | """A simple C++ reaction network for integrating into other C++ codes"""
import glob
import os
from pynucastro.networks.base_cxx_network import BaseCxxNetwork
class SimpleCxxNetwork(BaseCxxNetwork):
def __init__(self, *args, **kwargs):
# Initialize BaseCxxNetwork parent class
super().__init__(... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,705 | pynucastro/pynucastro | refs/heads/main | /pynucastro/__init__.py | """pynucastro is a python module that interprets the nuclear reaction rates,
including those cataloged by the JINA ReacLib project:
https://reaclib.jinaweb.org/
It provides both interactive access to the rates, for use in Jupyter
notebooks as well as methods for writing python and C++ nuclear
reaction networks, inclu... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,706 | pynucastro/pynucastro | refs/heads/main | /pynucastro/reduction/generate_data.py | #!/usr/bin/env python3
import numpy as np
from pynucastro import Composition, Nucleus
from pynucastro.reduction.load_network import load_network
def dataset(network, n=10, permute=True, b_rho=None, b_T=None, b_Z=None):
"""
Generate a dataset with *n* datapoints. Will either be returned as a sequence of tupl... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,707 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/tests/test_nucleus.py | from pytest import approx
from pynucastro.nucdata import Nucleus, get_nuclei_in_range
class TestNucleus:
@classmethod
def setup_class(cls):
""" this is run once for each class before any tests """
@classmethod
def teardown_class(cls):
""" this is run once for each class after all tes... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,708 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/PartitionFunction/convert_rathpf_2003.py | #!/usr/bin/env python
"""
Reformat Table 2 and Table 3 of Rauscher 2003
into a standard format for pynucastro.
These tables corresponds to:
Thomas Rauscher, Astrophysical Journal Supplement Series, 147:403-408, 2003
These table txt files are published together with the paper above
and are read unmodified by this scr... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,709 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/nucleus.py | """
Classes and methods to interface with files storing rate data.
"""
import os
import re
from scipy.constants import physical_constants
from pynucastro.nucdata.binding_table import BindingTable
from pynucastro.nucdata.elements import PeriodicTable
from pynucastro.nucdata.mass_table import MassTable
from pynucastro... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,710 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_validate.py | # unit tests for rates
import io
import pytest
import pynucastro as pyna
ANSWER = \
"""validation: ni56 produced in Fe52 + He4 ⟶ Ni56 + 𝛾 never consumed.
validation: ni56 produced in Co55 + p ⟶ Ni56 + 𝛾 never consumed.
validation: missing He4 + He4 + He4 ⟶ p + B11 as alternative to He4 + He4 + He4 ⟶ C12 + 𝛾 (Q = ... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,711 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/__init__.py | """The pynucastro modules that support the creation of networks.
There are several main submodules here:
:meth:`rate_collection <pynucastro.networks.rate_collection>`: this is
simply a collection of rates that knows about the links connecting
nuclei. This is used as the base for the different classes the write
code t... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,712 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/tests/test_jacobian_term.py | # unit tests for rates
import pytest
from pytest import approx
from pynucastro.networks import Composition
from pynucastro.nucdata import Nucleus
class TestJacTerm:
@pytest.fixture(scope="class")
def comp(self):
nuc_list = [Nucleus("he4"), Nucleus("c12"), Nucleus("o16"),
Nucleus(... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,713 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_nse.py | import pytest
import pynucastro as pyna
class TestNSE:
@pytest.fixture(scope="class")
def pynet(self, reaclib_library):
lib = reaclib_library.linking_nuclei(["p", "he4", "fe52",
"co55", "ni56"])
return pyna.RateCollection(libraries=lib)
def ... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,714 | pynucastro/pynucastro | refs/heads/main | /pynucastro/reduction/load_network.py | #!/usr/bin/env python3
import sys
from pynucastro.networks import PythonNetwork
from pynucastro.nucdata import Nucleus
from pynucastro.rates import Library, RateFilter
def load_network(endpoint=Nucleus('te108'), library_name='rp-process-lib'):
"""
Load a network from a library, filtering the library so only... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,715 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/tests/test_approx_rate.py | # unit tests for rates
import pytest
from pytest import approx
import pynucastro as pyna
class TestTfactors:
@pytest.fixture(scope="class")
def rc(self, reaclib_library):
mylib = reaclib_library.linking_nuclei(["mg24", "al27", "si28", "he4", "p"])
return pyna.RateCollection(libraries=[mylib]... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,716 | pynucastro/pynucastro | refs/heads/main | /pynucastro/reduction/drgep.py | import numpy as np
from pynucastro.reduction.reduction_utils import (mpi_importer,
mpi_numpy_decomp, to_list)
MPI = mpi_importer()
def calc_interaction_matrix(net, rvals):
"""Calculate direct interaction coefficients."""
N_species = len(net.unique_nuclei)
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,717 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/sympy_network_support.py | """This is a module that interprets the rates, ydots, and Jacobian
through sympy"""
import re
import sympy
from pynucastro.rates import TabularRate
class SympyRates:
def __init__(self):
self.symbol_ludict = {} # Symbol lookup dictionary
self._ydot_term_cache = {}
self.name_density =... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,718 | pynucastro/pynucastro | refs/heads/main | /conftest.py | """
Recent versions of numpy use AVX-512 routines from SVML to speed up some math
functions on processors that support it. These implementations allow a maximum
error of 4 ULP, which is looser than in previous versions. Our tests for
write_network() (and probably some others) expect exactly reproducible floating
point ... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,719 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/tests/test_rates.py | # unit tests for rates
import math
import pytest
from pytest import approx
from pynucastro import rates
from pynucastro.nucdata import Nucleus
class TestTfactors:
@pytest.fixture(scope="class")
def tf(self):
return rates.Tfactors(2.e9)
def test_tfactors(self, tf):
assert tf.T9 == approx... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,720 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_dupes.py | # unit tests for rates
import pytest
import pynucastro as pyna
class TestDuplicates:
@pytest.fixture(scope="class")
def ecsn_rc(self, reaclib_library):
all_nuclei = ["p", "he4",
"ne20", "o20", "f20",
"mg24", "al27", "o16",
"si28", "s3... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,721 | pynucastro/pynucastro | refs/heads/main | /.github/workflows/simple_cxx_network/test_simple_cxx.py | import pynucastro as pyna
lib = pyna.ReacLibLibrary().linking_nuclei(["he4", "c12", "o16", "ne20"])
net = pyna.SimpleCxxNetwork(libraries=[lib])
net.write_network()
| {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,722 | pynucastro/pynucastro | refs/heads/main | /pynucastro/screening/__init__.py | """Screening routines"""
__all__ = ["screen"]
from .screen import (PlasmaState, ScreenFactors, chugunov_2007, chugunov_2009,
make_plasma_state, make_screen_factors, potekhin_1998)
| {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,723 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_python_net.py | # unit tests for rates
import pytest
from pynucastro import rates
class TestPythonNetwork:
@pytest.fixture(scope="class")
def rate1(self):
return rates.ReacLibRate("c13-pg-n14-nacr")
@pytest.fixture(scope="class")
def rate2(self):
return rates.ReacLibRate("he4-pphe3-he3-nacr")
@... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,724 | pynucastro/pynucastro | refs/heads/main | /examples/CNO/cno.py | # CNO rate module generator
from pynucastro.networks import PythonNetwork
files = ["c12-pg-n13-ls09",
"c13-pg-n14-nacr",
"n13--c13-wc12",
"n13-pg-o14-lg06",
"n14-pg-o15-im05",
"n15-pa-c12-nacr",
"o14--n14-wc12",
"o15--n15-wc12"]
cno_net = PythonNetwork(fi... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,725 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/AtomicMassEvaluation/extract_spin.py | """
This script extract the spin data for each ground state (gs) nuclei,
characterized by the pair (A, Z), from nubase_3.mas20.txt, published in:
Kondev, F. G., Wang, M., Huang, W. J., Naimi, S., & Audi, G.
Chinese Physics C, 45(3), 030001. (2021) doi:10.1088/1674-1137/abddae
located in Table I.
"""
import argpar... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,726 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/rate_collection.py | """A collection of classes and methods to deal with collections of
rates that together make up a network."""
import collections
import copy
import functools
import math
import os
import warnings
from operator import mul
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,727 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/tests/test_spin.py | from pynucastro.nucdata import SpinTable
class TestSpin:
@classmethod
def setup_class(cls):
""" this is run once for each class before any tests """
@classmethod
def teardown_class(cls):
""" this is run once for each class before any tests """
def setup_method(self):
"""... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,728 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_rc_jacobian.py | # unit tests for a rate collection
import pytest
from pytest import approx
import pynucastro as pyna
class TestRateCollectionJacobian:
@pytest.fixture(scope="class")
def rc(self, reaclib_library):
mylib = reaclib_library.linking_nuclei(["he4", "c12", "o16", "ne20"],
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,729 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_cxx_amrexastro_approx_net.py | # unit tests for rates
import shutil
import pytest
import pynucastro as pyna
from pynucastro.networks.tests.helpers import compare_network_files
class TestAmrexAstroCxxNetwork:
@pytest.fixture(scope="class")
def fn(self, reaclib_library):
mylib = reaclib_library.linking_nuclei(["mg24", "al27", "si2... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,730 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/tests/test_mass.py | from pytest import approx
from pynucastro.nucdata import MassTable
class TestMass:
def test_mass_table(self):
_dm = MassTable()
assert _dm.get_mass_diff(a=1, z=0) == approx(8.07132)
assert _dm.get_mass_diff(a=4, z=2) == approx(2.42492)
assert _dm.get_mass_diff(a=295, z=118) == app... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,731 | pynucastro/pynucastro | refs/heads/main | /pynucastro/reduction/sensitivity_analysis.py | import numpy as np
from pynucastro.reduction.reduction_utils import mpi_importer
MPI = mpi_importer()
def binary_search_trim(network, nuclei, errfunc, thresh=0.05):
"""
Given an array of nuclei sorted roughly by relative importance, perform a binary search to trim
out nuclei from the network until the e... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,732 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_approx_python_net.py | # unit tests for rates
import importlib
import os
import sys
import numpy as np
import pytest
from pytest import approx
from scipy.integrate import solve_ivp
import pynucastro as pyna
from pynucastro.screening import chugunov_2007
class TestPythonNetwork:
@pytest.fixture(scope="class")
def pynet(self, reacl... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,733 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/__init__.py | """The core routines needed to read and interpret nuclear reaction rates"""
__all__ = ["rate", "library"]
from .library import (LangankeLibrary, Library, RateFilter, ReacLibLibrary,
SuzukiLibrary, TabularLibrary, list_known_rates)
from .rate import (ApproximateRate, DerivedRate, Rate, RateFileEr... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,734 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_cxx_amrexastro_net.py | # unit tests for rates
import io
import shutil
import pytest
from pynucastro import networks
from pynucastro.networks.tests.helpers import compare_network_files
class TestAmrexAstroCxxNetwork:
# pylint: disable=protected-access
@pytest.fixture(scope="class")
def fn(self):
files = ["c12-c12a-ne20... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,735 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_simple_cxx_net.py | # unit tests for rates
import shutil
import pytest
from pynucastro import networks
from pynucastro.networks.tests.helpers import compare_network_files
class TestSimpleCxxNetwork:
# pylint: disable=protected-access
@pytest.fixture(scope="class")
def fn(self):
files = ["c12-c12a-ne20-cf88",
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,736 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/helpers.py | import filecmp
import os
def compare_network_files(test_path, ref_path, skip_files=()):
base_path = os.path.relpath(os.path.dirname(__file__))
ref_path = os.path.join(base_path, ref_path)
skip_files = set(skip_files)
test_files = set(os.listdir(test_path)) - skip_files
ref_files = set(os.listdir(... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,737 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_rate_collection.py | # unit tests for a rate collection
import pytest
import pynucastro as pyna
class TestRateCollection:
@pytest.fixture(scope="class")
def rc(self, reaclib_library):
mylib = reaclib_library.linking_nuclei(["he4", "c12", "o16"])
return pyna.RateCollection(libraries=[mylib])
def test_get_rate... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,738 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/spin_table.py | import os
class SpinTable:
"""
This class stores the nubase2020_1.txt table information in a dictionary data structure
that maps nuclides to their number of nuclear spin states.
Therefore, after setting an SpinTable class in rates.py, we can retrieve the
spin states for a designated Nucleus class.... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,739 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/AtomicMassEvaluation/extract_mass_excess.py | import argparse
"""
This module extract the (A,Z, dm) tuples from `nubase_3.mas20.txt`, where:
:var A: is the atomic weight measured in atomic mass units.
:var Z: is the atomic number.
:var dm: is the mass difference A_{nuc}-A.
"""
#os.path.dirname(os.path.realpath(__file__))
parser = argparse.ArgumentParser()
pars... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,740 | pynucastro/pynucastro | refs/heads/main | /examples/triple-alpha/triple-alpha-cxx.py | # triple-alpha rate module generator
from pynucastro.networks import AmrexAstroCxxNetwork
files = ["c12-gaa-he4-fy05",
"he4-aag-c12-fy05"]
triple_alpha_net = AmrexAstroCxxNetwork(files)
triple_alpha_net.write_network()
| {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,741 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/AtomicMassEvaluation/extract_table.py | #!/usr/bin/env python
"""
Uses AMETable class to extract binding energy from an AME Table.
"""
import argparse
from ame_table import AMETable
parser = argparse.ArgumentParser()
parser.add_argument('table', type=str, help='Name of AME Table file. E.g. "mass.mas12".')
parser.add_argument('-o', '--output', type=str, def... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,742 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/AtomicMassEvaluation/ame_table.py | """
Reads AME tabular mass data file and supplies table data.
"""
# Common Imports
import os
from ame_nuclide import AMENuclide
def str_head_pop(s, n):
"""
Pop n characters from string s from the beginning.
Returns a tuple consisting of the new s and the popped characters.
"""
if n >= len(s):
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,743 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/amrexastro_cxx_network.py | """A C++ reaction network for integration into the AMReX Astro
Microphysics set of reaction networks used by astrophysical hydrodynamics
codes"""
import glob
import os
from pynucastro.networks.base_cxx_network import BaseCxxNetwork
from pynucastro.nucdata import Nucleus
from pynucastro.rates import ReacLibRate
cla... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,744 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/tests/test_binding.py | # unit tests for Binding Energy database taken from AME 2016.
from pytest import approx
from pynucastro.nucdata import BindingTable
class TestAME:
def test_get(self):
bintable = BindingTable()
assert bintable.get_binding_energy(n=1, z=1) == approx(1.112283)
assert bintable.get_binding_ene... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,745 | pynucastro/pynucastro | refs/heads/main | /pynucastro/rates/rate.py | """
Classes and methods to interface with files storing rate data.
"""
import io
import os
from collections import Counter
from enum import Enum
import matplotlib.pyplot as plt
import numpy as np
from scipy.constants import physical_constants
try:
import numba
from numba.experimental import jitclass
except I... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,746 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_python_partition_functions.py | import importlib
import os
import sys
import pytest
import pynucastro as pyna
class TestPythonPartitionNetwork:
@pytest.fixture(scope="class")
def pynet(self, reaclib_library):
fwd_reactions = reaclib_library.derived_forward()
nuclei = ["p", "he4", "fe52", "ni56", "co55"]
fwd_rate... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,747 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/partition_function.py | import os
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline
class PartitionFunction:
"""
This class holds the tabulated data for the partition function for a
specific nucleus, which can be combined with other (non-overlapping)
partition functions by addition and evaluated ... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,748 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_networks.py | # unit tests for networks
import pytest
from pytest import approx
from pynucastro import networks
from pynucastro.nucdata import Nucleus
class TestComposition:
@pytest.fixture(scope="class")
def nuclei(self):
return [Nucleus("h1"),
Nucleus("he4"),
Nucleus("c12"),
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,749 | pynucastro/pynucastro | refs/heads/main | /pynucastro/reduction/reduction.py | #!/usr/bin/env python3
import argparse
import sys
import time
from collections import namedtuple
import numpy as np
from pynucastro import Composition, Nucleus
from pynucastro.reduction import drgep, mpi_importer, sens_analysis
from pynucastro.reduction.generate_data import dataset
from pynucastro.reduction.load_net... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,750 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_derived_network.py | # unit tests for rates
import numpy as np
import pytest
import pynucastro as pyna
class TestPythonDerivedNetwork:
@pytest.fixture(scope='class')
def pynet(self, reaclib_library):
fwd_reactions = reaclib_library.derived_forward()
intermediate_nuclei = ['cr48', 'mn51', 'fe52', 'ni56', 'p', 'n... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,751 | pynucastro/pynucastro | refs/heads/main | /pynucastro/nucdata/elements.py | class Element:
def __init__(self, abbreviation, name, Z):
self.abbreviation = abbreviation
self.name = name
self.Z = Z
class UnidentifiedElement(Exception):
pass
class PeriodicTable:
table = {'h': Element('h', 'hydrogen', 1),
'he': Element('he', 'helium', 2),
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,752 | pynucastro/pynucastro | refs/heads/main | /examples/CNO/burn.py | import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import ode
import cno_rhs as cno
def burn(Y0, rho, T, tmax, nsave):
r = ode(cno.rhs).set_integrator("vode", method="bdf",
with_jacobian=False,
atol=1.e-8, rtol=1.e-8,
... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,753 | pynucastro/pynucastro | refs/heads/main | /setup.py | from setuptools import setup, find_packages
setup(name='pynucastro',
description='A python library for nuclear astrophysics',
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
url='https://github.com/pynucastro/pynucastro',
author='pynucastro d... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,754 | pynucastro/pynucastro | refs/heads/main | /pynucastro/networks/tests/test_cxx_amrexastro_derived_net.py | # unit test for C++ network with derived rates using partition functions
import shutil
import pytest
import pynucastro as pyna
from pynucastro.networks.tests.helpers import compare_network_files
class TestAmrexAstroCxxNetwork:
@pytest.fixture(scope="class")
def fn(self, reaclib_library):
# based on ... | {"/pynucastro/reduction/__init__.py": ["/pynucastro/reduction/drgep.py", "/pynucastro/reduction/reduction_utils.py", "/pynucastro/reduction/sensitivity_analysis.py"], "/pynucastro/networks/tests/_python_reference/network.py": ["/pynucastro/rates/__init__.py", "/pynucastro/screening/__init__.py", "/pynucastro/__init__.p... |
46,778 | evinceng/mvc | refs/heads/master | /Controller.py | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 04 13:13:48 2018
@author: evin
"""
import Model
import View
import Tkinter as Tk
import matplotlib.animation as animation
class Controller():
def __init__(self):
self.root = Tk.Tk()
self.model=Model.Model()
self.view=View.View(self.root)
... | {"/Controller.py": ["/Model.py", "/View.py"]} |
46,779 | evinceng/mvc | refs/heads/master | /View.py | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 04 13:12:21 2018
@author: evin
"""
import Tkinter as Tk
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import matplotlib.pyplot as plt
class View():
def __init__(self, master):
self.frame = Tk.Frame(maste... | {"/Controller.py": ["/Model.py", "/View.py"]} |
46,780 | evinceng/mvc | refs/heads/master | /Model.py | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 04 13:13:48 2018
@author: evin
"""
import time
from random import randint
import collections
class Model():
def __init__(self):
self.xs=collections.deque(5*[0], 5)
self.ys=collections.deque(5*[0], 5)
def calculate(self):
self.xs.ap... | {"/Controller.py": ["/Model.py", "/View.py"]} |
46,798 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/error.py | # Fitbit2Influx Error Classes
class Error(Exception):
'''Base Class for Fitbit2Influx Errors'''
default_code = 500
def __init__(self, *args, **kwargs):
self.status_code = kwargs.pop(
'status_code', self.__class__.default_code
)
super(Error, self).__init__(*args, **kwarg... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,799 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/scheduler.py | # Fitbit2Influx Scheduler Support
import datetime
import shelve
from apscheduler.schedulers.background import BackgroundScheduler
from flask import current_app
from functools import wraps
from fitbit2influx.influx import influx
from fitbit2influx.service.fitbit import get_heartrate, get_user_profile
class APSchedu... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,800 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/__init__.py | # Fitbit2Influx Flask Application
from dotenv import find_dotenv, load_dotenv
load_dotenv(find_dotenv(), verbose=True)
| {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,801 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/settings.py | # Default Settings File
APP_SESSION_KEY = 'fitbit2influx-test-session-key'
# Fitbit Web Hosts
FITBIT_WEB_HOST = 'www.fitbit.com'
FITBIT_API_HOST = 'api.fitbit.com'
# Fitbit Application Information
# CLIENT_ID = None
# CLIENT_SECRET = None
CALLBACK_URL = '/authorize'
# Token Validity in ms (default: 1 hr per Fitbit)
... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,802 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/blueprints/status.py | # Fitbit2Influx Status Page
import shelve
from flask import Blueprint, current_app, render_template
from ..influx import influx
from ..scheduler import scheduler
bp = Blueprint('status', __name__, url_prefix='/', template_folder='templates')
@bp.route('/', methods=['GET'])
def status_index():
'''Show the Index... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,803 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/influx.py | # Fitbit2InfluxDB Influx Connection
import influxdb
class InfluxDB(object):
'''InfluxDB Helper for Flask'''
def __init__(self, app=None):
self._client = None
self.app = app
if app:
self.init_app(app)
def init_app(self, app):
'''Setup the InfluxDB Connection'''... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,804 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/wsgi.py | # Fitbit2Influx WSGI Helper
from .factory import create_app
app = create_app()
| {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,805 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/factory.py | # Fitbit2Influx Applicatin Factory
import configparser
import pathlib
import os
from flask import Flask
def read_version():
'''Read the Name and Version String from pyproject.toml'''
# Search for pyproject.toml
d = pathlib.Path(__file__)
name = None
version = None
while d.parent != d:
... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,806 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/blueprints/oauth.py | # Fitbit2Influx OAuth2 Helpers
from flask import Blueprint, current_app, redirect, request
from fitbit2influx.error import NeedAuthError
from fitbit2influx.service import oauth as oauth_service
bp = Blueprint('oauth', __name__, url_prefix='/')
@bp.route('/authorize', methods=['GET'])
def oauth_authorize():
'''... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,807 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/service/fitbit.py | # Fitbit2Influx Fitbit Service
import datetime
import requests
from urllib.parse import quote, urlencode, urlunparse
from fitbit2influx.error import ApiError
from .oauth import get_api_token
def api_get(app, url_endpoint, query=None, headers={}, **kwargs):
'''Perform a GET request to the Fitbit API'''
tok... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,808 | asymworks/fitbit2influx | refs/heads/main | /fitbit2influx/service/oauth.py | # Fitbit2Influx OAuth2 Service
import datetime
import requests
import shelve
from urllib.parse import quote, urlencode, urlunparse
from fitbit2influx.error import ApiError, ConfigError, NeedAuthError
def init_oauth(app):
'''
Construct the Fitbit Authorization URL
Construct the URL for Fitbit OAuth2 Au... | {"/fitbit2influx/scheduler.py": ["/fitbit2influx/influx.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/blueprints/status.py": ["/fitbit2influx/influx.py", "/fitbit2influx/scheduler.py", "/fitbit2influx/service/fitbit.py"], "/fitbit2influx/wsgi.py": ["/fitbit2influx/factory.py"], "/fitbit2influx/factory.py": ... |
46,836 | maciejbiesek/poleval-cyberbullying | refs/heads/master | /run_svm.py | import argparse
from dataset import Dataset
from models.svm_classifier import SVMClassifier
def parse_args():
parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser.add_argument("--text_corpus", type=str, required=True, help="Path to twitter messages in txt file")
parent_parser.add_argumen... | {"/run_svm.py": ["/dataset.py", "/models/svm_classifier.py"], "/utils.py": ["/config.py"], "/dataset.py": ["/config.py"], "/models/flair_classifier.py": ["/config.py"], "/run_rnn.py": ["/config.py", "/dataset.py", "/models/gru_classifier.py", "/utils.py"], "/models/svm_classifier.py": ["/config.py"], "/run_flair.py": [... |
46,837 | maciejbiesek/poleval-cyberbullying | refs/heads/master | /utils.py | from random import randint
from scipy import stats
from sklearn.metrics import accuracy_score, f1_score
from config import Parser
def evaluate_baselines(true_y):
args = Parser().get_section('GENERAL')
most_frequent_label = stats.mode(true_y).mode[0]
most_frequent_label_baseline = [most_frequent_label fo... | {"/run_svm.py": ["/dataset.py", "/models/svm_classifier.py"], "/utils.py": ["/config.py"], "/dataset.py": ["/config.py"], "/models/flair_classifier.py": ["/config.py"], "/run_rnn.py": ["/config.py", "/dataset.py", "/models/gru_classifier.py", "/utils.py"], "/models/svm_classifier.py": ["/config.py"], "/run_flair.py": [... |
46,838 | maciejbiesek/poleval-cyberbullying | refs/heads/master | /dataset.py | import os
import pickle
import re
import string
from collections import Counter
import numpy as np
import pandas as pd
from gensim.models.keyedvectors import KeyedVectors
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from spacy.lang.pl import Polish
from config import Parser
... | {"/run_svm.py": ["/dataset.py", "/models/svm_classifier.py"], "/utils.py": ["/config.py"], "/dataset.py": ["/config.py"], "/models/flair_classifier.py": ["/config.py"], "/run_rnn.py": ["/config.py", "/dataset.py", "/models/gru_classifier.py", "/utils.py"], "/models/svm_classifier.py": ["/config.py"], "/run_flair.py": [... |
46,839 | maciejbiesek/poleval-cyberbullying | refs/heads/master | /models/flair_classifier.py | import os
from pathlib import Path
from flair.data import Sentence
from flair.data_fetcher import NLPTaskDataFetcher
from flair.embeddings import WordEmbeddings, FlairEmbeddings, DocumentRNNEmbeddings
from flair.models import TextClassifier
from flair.trainers import ModelTrainer
from flair.training_utils import Evalu... | {"/run_svm.py": ["/dataset.py", "/models/svm_classifier.py"], "/utils.py": ["/config.py"], "/dataset.py": ["/config.py"], "/models/flair_classifier.py": ["/config.py"], "/run_rnn.py": ["/config.py", "/dataset.py", "/models/gru_classifier.py", "/utils.py"], "/models/svm_classifier.py": ["/config.py"], "/run_flair.py": [... |
46,840 | maciejbiesek/poleval-cyberbullying | refs/heads/master | /run_rnn.py | import argparse
from config import Parser
from dataset import Dataset
from models.gru_classifier import GRU
from utils import evaluate_baselines
def parse_args():
parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser.add_argument("--text_corpus", type=str, required=True, help="Path to twitter... | {"/run_svm.py": ["/dataset.py", "/models/svm_classifier.py"], "/utils.py": ["/config.py"], "/dataset.py": ["/config.py"], "/models/flair_classifier.py": ["/config.py"], "/run_rnn.py": ["/config.py", "/dataset.py", "/models/gru_classifier.py", "/utils.py"], "/models/svm_classifier.py": ["/config.py"], "/run_flair.py": [... |
46,841 | maciejbiesek/poleval-cyberbullying | refs/heads/master | /models/svm_classifier.py | import pickle
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.metrics import accuracy_score, f1_score
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from s... | {"/run_svm.py": ["/dataset.py", "/models/svm_classifier.py"], "/utils.py": ["/config.py"], "/dataset.py": ["/config.py"], "/models/flair_classifier.py": ["/config.py"], "/run_rnn.py": ["/config.py", "/dataset.py", "/models/gru_classifier.py", "/utils.py"], "/models/svm_classifier.py": ["/config.py"], "/run_flair.py": [... |
46,842 | maciejbiesek/poleval-cyberbullying | refs/heads/master | /run_flair.py | import argparse
from dataset import Dataset
from models.flair_classifier import FlairClassifier
def parse_args():
parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser.add_argument("--text_corpus", type=str, required=False, help="Path to twitter messages in txt file")
parent_parser.add_ar... | {"/run_svm.py": ["/dataset.py", "/models/svm_classifier.py"], "/utils.py": ["/config.py"], "/dataset.py": ["/config.py"], "/models/flair_classifier.py": ["/config.py"], "/run_rnn.py": ["/config.py", "/dataset.py", "/models/gru_classifier.py", "/utils.py"], "/models/svm_classifier.py": ["/config.py"], "/run_flair.py": [... |
46,843 | maciejbiesek/poleval-cyberbullying | refs/heads/master | /models/gru_classifier.py | import os
import numpy as np
import tensorflow as tf
from sklearn.metrics import f1_score
from tensorflow.contrib.layers import fully_connected, dropout
from tensorflow.contrib.rnn import DropoutWrapper, GRUCell
from config import Parser
class GRU:
def __init__(self, dataset, is_train=True):
parser = Pa... | {"/run_svm.py": ["/dataset.py", "/models/svm_classifier.py"], "/utils.py": ["/config.py"], "/dataset.py": ["/config.py"], "/models/flair_classifier.py": ["/config.py"], "/run_rnn.py": ["/config.py", "/dataset.py", "/models/gru_classifier.py", "/utils.py"], "/models/svm_classifier.py": ["/config.py"], "/run_flair.py": [... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.