ascl_id
stringclasses
752 values
repo_url
stringclasses
737 values
file_path
stringlengths
4
194
content
large_stringlengths
1
1M
language
stringclasses
29 values
license_type
stringclasses
24 values
size
int64
1
1M
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/light_curve/light_curve_py/features/rainbow/_scaler.py
from dataclasses import dataclass from typing import Dict, Union import numpy as np from numpy.typing import NDArray __all__ = ["Scaler", "MultiBandScaler"] @dataclass() class Scaler: """Shift and scale arrays""" shift: Union[float, NDArray] """Scale to apply to the array Either a single value or ...
Python
Unknown
2,648
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/arrow_input.rs
use arrow_array::types::{ArrowPrimitiveType, Float32Type, Float64Type}; use arrow_buffer::ArrowNativeType; use arrow_schema::DataType; use pyo3::prelude::*; use pyo3_arrow::PyChunkedArray; use crate::errors::{Exception, Res}; /// Bridge trait: maps f32→Float32Type, f64→Float64Type for downcasting arrow arrays. pub(cr...
Rust
Unknown
7,317
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/check.rs
use crate::errors::{Exception, Res}; use itertools::Itertools; use light_curve_feature::Float; use ndarray::{ArrayView1, Zip}; pub(crate) fn is_sorted<T>(a: &[T]) -> bool where T: PartialOrd, { a.iter().tuple_windows().all(|(a, b)| a < b) } pub(crate) fn check_sorted<T>(a: &[T], sorted: Option<bool>) -> Res<...
Rust
Unknown
1,395
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/features.rs
use crate::arrow_input::{ ArrowDtype, ArrowFloat, ArrowLcsSchema, ArrowListType, PyArrowFields, validate_arrow_lcs, }; use crate::check::{check_finite, check_no_nans, is_sorted}; use crate::cont_array::ContCowArray; use crate::errors::{Exception, Res}; use crate::ln_prior::LnPrior1D; use crate::np_array::Arr; use c...
Rust
Unknown
86,823
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/lib.rs
use dmdt::DmDt; use features as f; use ln_prior::*; #[cfg(feature = "mimalloc")] use mimalloc::MiMalloc; use pyo3::prelude::*; #[macro_use] mod np_array; mod arrow_input; mod check; mod cont_array; mod dmdt; mod errors; mod features; mod ln_prior; mod transform; #[cfg(feature = "mimalloc")] #[global_allocator] static...
Rust
Unknown
2,959
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/dmdt.rs
use crate::check::check_sorted; use crate::cont_array::{ContArray, ContCowArray}; use crate::errors::{Exception, Res}; use crate::np_array::Arr; use crate::errors::Exception::ValueError; use conv::{ApproxFrom, ApproxInto, ConvAsUtil}; use enumflags2::{BitFlags, bitflags}; use light_curve_dmdt as lcdmdt; use light_curv...
Rust
Unknown
54,126
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/cont_array.rs
use ndarray::{Array1, ArrayBase, ArrayView1, CowRepr, Ix1, OwnedRepr, RawData, ViewRepr}; use num_traits::Zero; use numpy::Element; pub struct ContArrayBase<S: RawData>(pub ArrayBase<S, Ix1>); pub type ContArray<T> = ContArrayBase<OwnedRepr<T>>; pub type ContArrayView<'a, T> = ContArrayBase<ViewRepr<&'a T>>; pub type...
Rust
Unknown
2,241
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/errors.rs
use pyo3::PyErr; use pyo3::exceptions::{ PyIndexError, PyNotImplementedError, PyRuntimeError, PyTypeError, PyValueError, }; use pyo3::import_exception; use std::fmt::Debug; use std::result::Result; use thiserror::Error; import_exception!(pickle, PicklingError); import_exception!(pickle, UnpicklingError); #[allow(...
Rust
Unknown
1,689
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/np_array.rs
use crate::errors::{Exception, Res}; use numpy::prelude::*; use numpy::{ AllowTypeChange, PyArray1, PyArrayLike1, PyReadonlyArray1, PyUntypedArray, PyUntypedArrayMethods, }; use pyo3::prelude::*; use unarray::UnarrayArrayExt; pub(crate) type Arr<'a, T> = PyReadonlyArray1<'a, T>; pub(crate) trait DType { ...
Rust
Unknown
10,416
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/transform.rs
use crate::errors::{Exception, Res}; use enum_iterator::Sequence; use light_curve_feature::transformers::{ Transformer, arcsinh::ArcsinhTransformer, clipped_lg::ClippedLgTransformer, identity::IdentityTransformer, lg::LgTransformer, ln1p::Ln1pTransformer, sqrt::SqrtTransformer, }; use pyo3::prelude::*; use pyo...
Rust
Unknown
4,632
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/src/ln_prior.rs
/// Prior classes and constructors for *Fit feature evaluators use crate::errors::{Exception, Res}; use light_curve_feature as lcf; use pyo3::prelude::*; use pyo3::types::PyBytes; use serde::{Deserialize, Serialize}; /// Logarithm of prior for *Fit feature extractors /// /// Construct instances of this class using st...
Rust
Unknown
4,326
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/conftest.py
def patch_astropy_for_feets(): """Feets is incompatible with astropy v6.0 because of backward incompatible changes in the subpackage structure. This function monkey patches astropy to make it compatible with feets. """ import importlib import sys from importlib.metadata import version t...
Python
Unknown
719
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/test_w_bench.py
import dataclasses from functools import lru_cache, wraps from itertools import count from pathlib import Path from typing import Generator, Iterator, List, Optional, Union import cesium.featurize import numpy as np import pandas as pd import pytest from joblib import Parallel, delayed from numpy.testing import assert...
Python
Unknown
24,435
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/test_call.py
import pytest from light_curve.light_curve_py import MaximumSlope def test_normalize(): t = [1, 4, 3, 8] m = [2, 15, 4, 3] feature = MaximumSlope() actual = feature(t, m, None, sorted=False) desired = 11.0 assert actual == desired def test_fill_zero_division(): t = [1, 1, 3, 4] feat...
Python
Unknown
964
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/test_single_band.py
import numpy as np import pytest from light_curve.light_curve_py import LinearFit def test_no_init_bands_no_input_bands(): """Announce no bands, use no bands""" t = [1.0, 2.0, 3.0, 4.0, 5.0] m = [1.0, 2.0, 3.0, 4.0, 5.0] sigma = [1.0, 1.0, 1.0, 1.0, 1.0] feature = LinearFit(bands=None) _value...
Python
Unknown
3,299
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_bins.py
import numpy as np from light_curve.light_curve_py import Amplitude, Bins, Mean, Median def test_bins_1(): feature = Bins(window=1.0, offset=100) t = np.array([0.0, 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 5.0]) m = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) sigma = np.arr...
Python
Unknown
2,079
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_excvar.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import ExcessVariance def test_excvar(): m = [1, 1, 2, 3, 4, 5] sigma = [0.5, 0.5, 0.5, 0.5, 0.5, 0.2] feature = ExcessVariance() actual = feature(np.linspace(0, 1, len(m)), m, sigma) desired = 0.34476562...
Python
Unknown
359
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_linfit.py
import numpy as np from numpy.testing import assert_allclose from scipy.optimize import curve_fit from light_curve.light_curve_py import LinearFit def test_linfit(): def f(x, slope, c): return x * slope + c t = np.array([2.0, 4.0, 7.0, 10.0, 15.0, 28.0]) m = np.array([1.0, 3.0, 6.0, 10.0, 14.0, ...
Python
Unknown
702
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_meanvar.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import MeanVariance def test_meanvar(): feature = MeanVariance() m = [1, 1, 2, 2, 3, 3, 4, 4] actual = feature(np.linspace(0, 1, len(m)), m, None) desired = 0.47809144373375745 assert_allclose(actual, des...
Python
Unknown
326
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_extractor.py
import numpy as np from light_curve.light_curve_ext import Eta, Mean from light_curve.light_curve_ext import _FeatureEvaluator as _RustBaseFeature from light_curve.light_curve_py import Amplitude, Extractor, OtsuSplit from light_curve.light_curve_py.features._base import BaseSingleBandFeature as _PythonBaseFeature d...
Python
Unknown
1,915
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_otsusplit.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import OtsuSplit def test_otsu_1(): feature = OtsuSplit() m = np.array([0.5, 1.5, 1.5, 1.5]) t = np.linspace(0, 1.7, 4) actual = feature(t, m, None) desired = [1.0, 0.0, 0.0, 0.25] assert_allclose(act...
Python
Unknown
1,307
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_percampl.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import PercentAmplitude def test_medabsdev(): m = [1.0, 1.0, 3.0, 4.0, 7.0] feature = PercentAmplitude() actual = feature(np.linspace(0, 1, len(m)), m, None) desired = 4.0 assert_allclose(actual, desired)...
Python
Unknown
321
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_median.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Median def test_median_1(): n = 9 m = np.arange(n) feature = Median() actual = feature(m, m, None) m = sorted(m) desired = m[n // 2] assert_allclose(actual, desired) def test_median_2(): ...
Python
Unknown
509
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_skew.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Skew def test_skew(): m = [1.0, 2.0, 3.0, 50.0, 25.0] feature = Skew() actual = feature(np.linspace(0, 1, len(m)), m, None) desired = 1.307253786 assert_allclose(actual, desired)
Python
Unknown
302
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_cusum.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Cusum def test_cusum(): m = [1, 2, 3, 4, 5, 5] feature = Cusum() actual = feature(np.linspace(0, 1, len(m)), m, None) desired = 0.408248290463863 assert_allclose(actual, desired)
Python
Unknown
302
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_roms.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Roms def test_roms_const_data(): feature = Roms() n = 100 t = np.arange(n) m = np.ones_like(t) sigma = np.ones_like(t) actual = feature(t, m, sigma) desired = 0.0 assert_allclose(actual...
Python
Unknown
2,456
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_mean.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Mean def test_mean_1(): n = 10 feature = Mean() m = np.arange(10) desired = sum(m) / n actual = feature(m, m, None) assert_allclose(actual, desired) def test_mean_2(): feature = Mean() ...
Python
Unknown
450
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_maxslope.py
from numpy.testing import assert_allclose from light_curve.light_curve_py import MaximumSlope def test_maxslope(): m = [2, 4, 15, 3] t = [1, 3, 4, 8] feature = MaximumSlope() actual = feature(t, m, None) desired = 11.0 print(actual) assert_allclose(actual, desired)
Python
Unknown
297
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_medabsdev.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import MedianAbsoluteDeviation def test_medabsdev(): m = [1.0, 1.0, 3.0, 4.0, 7.0] feature = MedianAbsoluteDeviation() actual = feature(np.linspace(0, 1, len(m)), m, None) desired = 2.0 assert_allclose(ac...
Python
Unknown
335
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_redchi2.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import ReducedChi2 def test_redchi2_equal_sigma(): m = np.array([1.0, 1.0, 2.0, 3.0, 4.0, 5.0]) sigma = np.array([0.5, 0.5, 0.5, 0.5, 0.5, 0.5]) feature = ReducedChi2() desired = feature(np.linspace(0, 1, len...
Python
Unknown
650
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_eta.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Eta def test_eta(): a = np.array([1, 2, 3, 3, 3, 4, 4]) feature = Eta() actual = feature(np.linspace(0, 1, len(a)), a, None) desired = 0.43750000000000006 assert_allclose(actual, desired)
Python
Unknown
311
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_n_not_det_before_fd.py
import numpy as np import pytest from light_curve.light_curve_py import FluxNNotDetBeforeFd, MagnitudeNNotDetBeforeFd def test_flux(): feature = FluxNNotDetBeforeFd(signal_to_noise=10) m = np.array([1, 2, 10, 40, 50]) t = [1, 2, 3, 4, 5] sigma = np.array([0.4, 0.2, 0.01, 0.03, 0.02]) actual = fea...
Python
Unknown
1,687
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_etae.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Eta, EtaE def test_etae_1(): a = np.array([1, 2, 3, 8]) t = np.array([1, 3, 5, 7]) feature = EtaE() feature_2 = Eta() actual = feature(t, a, None) actual_2 = feature_2(t, a, None) assert_al...
Python
Unknown
562
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_amplitude.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Amplitude def test_amplitude(): n = 11 feature = Amplitude() m = np.arange(n) desired = (n - 1) / 2 actual = feature(m, m, None) assert_allclose(actual, desired)
Python
Unknown
289
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_color_of_median.py
import pytest from light_curve.light_curve_py import ColorOfMedian def test_color_of_median(): m = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] band = ["g", "g", "g", "r", "r", "r", "i"] feature = ColorOfMedian("g", "r") actual = feature(t=m, m=m, sigma=None, band=band) desired = -3.0 assert actual =...
Python
Unknown
610
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_intpercrange.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import InterPercentileRange def test_intpercrange_1(): m = np.arange(1.0, 7.0) feature = InterPercentileRange() actual = feature(m, m) desired = 3.0 assert_allclose(actual, desired) def test_intpercrang...
Python
Unknown
487
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_medbufrperc.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import MedianBufferRangePercentage def test_medbufrperc(): m = np.arange(1.0, 8.0) feature = MedianBufferRangePercentage() actual = feature(m, m, None) desired = 1 / 7 assert_allclose(actual, desired)
Python
Unknown
317
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_stetsonk.py
import numpy as np from numpy.testing import assert_allclose from scipy import signal from light_curve.light_curve_py import StetsonK def test_stetsonk_1(): feature = StetsonK() x = np.linspace(0.0, 2 * np.pi, 2000) sin = np.sin(x) error = np.ones(2000) actual = feature(x, sin, error) desired...
Python
Unknown
673
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_magnpratio.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import MagnitudePercentageRatio def test_magnpratio_1(): m = np.arange(1.0, 11.0) feature = MagnitudePercentageRatio() feature2 = MagnitudePercentageRatio(quantile_numerator=0.4, quantile_denominator=0.05) ac...
Python
Unknown
688
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_ptp_var.py
import numpy as np import scipy.stats as st from numpy.testing import assert_allclose from light_curve.light_curve_py import PeakToPeakVar def test_ptpvar(): feature = PeakToPeakVar() rng = np.random.default_rng(0) n = 100 lmd = 200 t = np.arange(n) flux = rng.poisson(lmd, n) sigma = np.s...
Python
Unknown
963
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_beyondnstd.py
from numpy.testing import assert_allclose from light_curve.light_curve_py import BeyondNStd def test_beyondnstd_1(): m = [1.0, 2.0, 3.0, 4.0, 5.0, 10.0] feature = BeyondNStd(nstd=1.0) feature_2 = BeyondNStd() actual = feature(m, m) actual_2 = feature_2(m, m) desired = 1 / 6 assert_allclos...
Python
Unknown
526
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_weightmean.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import WeightedMean def test_weightmean(): a = [2.0, 3.0, 1.0, 9.0, 5.0] b = [0.3, 0.4, 0.5, 1, 1] feature = WeightedMean() actual = feature(np.linspace(0, 1, len(a)), a, b) desired = 2.52437574316 as...
Python
Unknown
351
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_pdiffmperc.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import PercentDifferenceMagnitudePercentile def test_pdiffmperc(): m = np.arange(1.0, 7.0) feature = PercentDifferenceMagnitudePercentile(quantile=0.25) actual = feature(m, m) desired = 3.0 / 3.5 assert_a...
Python
Unknown
345
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_lintrend.py
import numpy as np from numpy.testing import assert_allclose from scipy.optimize import curve_fit from light_curve.light_curve_py import LinearTrend def test_lintrend_1(): def f(x, slope, c): return x * slope + c m = np.array([2.0, 4.0, 7.0, 10.0, 15.0, 28.0]) t = np.array([1.0, 3.0, 6.0, 10.0, ...
Python
Unknown
939
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_kurtosis.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import Kurtosis def test_kurtosis(): m = [ 1.52403507, -0.47585435, 1.30247288, -0.26769695, -1.89584998, 0.30886293, -1.08824993, 1.17991399, -0.61...
Python
Unknown
497
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_rainbow.py
import numpy as np from light_curve.light_curve_py import RainbowFit from light_curve.light_curve_py.features.rainbow._scaler import MultiBandScaler def test_noisy_with_baseline(): rng = np.random.default_rng(0) band_wave_aa = {"g": 4770.0, "r": 6231.0, "i": 7625.0, "z": 9134.0} reference_time = 60000....
Python
Unknown
5,172
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_adnormal.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import AndersonDarlingNormal def test_adnormal(): m = np.arange(0, 9) feature = AndersonDarlingNormal() desired = feature(m, m, None) actual = 0.155339690 assert_allclose(actual, desired)
Python
Unknown
304
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_py/features/test_stdev.py
import numpy as np from numpy.testing import assert_allclose from light_curve.light_curve_py import StandardDeviation def test_stdev(): m = np.arange(10) feature = StandardDeviation() actual = feature(m, m, None) m_sum = sum((m - np.mean(m)) ** 2) desired = np.sqrt(m_sum / (len(m) - 1)) asser...
Python
Unknown
348
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_ext/test_periodogram.py
import numpy as np import pytest from numpy.testing import assert_allclose from scipy.signal import lombscargle from light_curve.light_curve_ext import Periodogram def test_vs_lombscargle(): rng = np.random.default_rng(None) n = 100 t = np.sort(rng.normal(0, 1, n)) m = np.sin(12.3 * t) + 0.2 * rng.n...
Python
Unknown
5,257
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_ext/test_dmdt.py
import copy import pickle from itertools import product try: from contextlib import nullcontext except ImportError: from contextlib import contextmanager @contextmanager def nullcontext(enter_result=None): yield enter_result import numpy as np import pytest from numpy.testing import assert_a...
Python
Unknown
12,493
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_ext/test_feature.py
import copy import inspect import pickle from concurrent.futures import ThreadPoolExecutor from itertools import chain import arro3.core import numpy as np import pyarrow as pa import pytest from numpy.testing import assert_allclose, assert_array_equal import light_curve.light_curve_ext as lc def _feature_classes(m...
Python
Unknown
32,574
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve/tests/light_curve_ext/test_ln_prior.py
import copy import pickle import pytest from light_curve.light_curve_ext import ln_prior LN_PRIORS = [ ln_prior.none(), ln_prior.log_normal(1.0, 2.0), ln_prior.log_uniform(1.0, 10.0), ln_prior.normal(-1.0, 3.0), ln_prior.uniform(-2.0, 1.0), ln_prior.mix([(0.5, ln_prior.uniform(0.0, 1.0)), (0....
Python
Unknown
786
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve-python/Cargo.toml
[package] name = "light-curve-python" version = "0.12.0" authors = [ "Konstantin Malanchev <hombit@gmail.com>", "Anastasia Lavrukhina <lavrukhina.ad@gmail.com>", "Sergey Karpov", "Etienne Russeil", ] description = "Feature extractor from noisy time series" readme = "README.md" repository = "https://gith...
TOML
Unknown
1,869
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve-python/README.md
# `light-curve-python` `light-curve-python` had been a previous name of the [`light-curve`](https://github.com/light-curve/light-curve-python) package. Now this is an empty package which depends on `light-curve` only.
Markdown
Unknown
219
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve-python/setup.py
import toml from setuptools import setup def get_light_curve_version(): with open("Cargo.toml") as fh: cargo_toml = toml.load(fh) package = cargo_toml["package"] version = package["version"] return version def main(): version = get_light_curve_version() requirement = f"light-curve[fu...
Python
Unknown
459
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve-python/pyproject.toml
[build-system] requires = ["setuptools", "toml", "wheel"] build-backend = "setuptools.build_meta"
TOML
Unknown
98
[ascl:2312.019]
https://github.com/light-curve/light-curve-python
light-curve-python/setup.cfg
[metadata] name = light-curve-python author = Konstantin Malanchev author_email = hombit@gmail.com description = An alias to light-curve package long_description = file: README.md long_description_content_type = text/markdown url = http://github.com/hombit/light-curve license = MIT keywords = science, astrophysics clas...
Config
Unknown
577
[ascl:2103.016]
https://github.com/rossjturner/RAiSERed
README.md
# RAiSERed [![DOI](https://img.shields.io/badge/DOI-10.1093/mnras/staa3067-blue.svg)](https://doi.org/10.1093/mnras/staa3067) <a href="https://ascl.net/2103.016"><img src="https://img.shields.io/badge/ascl-2103.016-blue.svg?colorB=262255" alt="ascl:2103.016" /></a> Radio-frequency AGN standard ruler code described by ...
Markdown
MIT
374
[ascl:2103.016]
https://github.com/rossjturner/RAiSERed
RAiSERed.py
# RAiSERed module # Ross Turner, 17 May 2020 # import packages import astropy.units as u import math import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib.patches as mpatches import numpy as np import scipy.fftpack import warnings from astropy.cosmology import FlatLambdaCDM from functoo...
Python
MIT
42,706
[ascl:2302.022]
https://github.com/andresmegias/radex-line-fitter
radexfit.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ RADEX Line Fitter ----------------- Version 1.4 Copyright (C) 2026 Andrés Megías Toledano This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either ...
Python
Unknown
63,148
[ascl:2302.022]
https://github.com/andresmegias/radex-line-fitter
README.md
# RADEX Line Fitter Python interface for using the software RADEX to fit observed transition lines. It consists of a Python 3 script, `radexfit.py`, which is used with RADEX locally. You can check the user guide ([`userguide.pdf`](https://github.com/andresmegias/radex-python/blob/main/userguide.pdf)) and the example ...
Markdown
Unknown
381
[ascl:2302.022]
https://github.com/andresmegias/radex-line-fitter
examples/L1517B-CH3OH.yaml
input files: MADCUBA table: - L1517B-madcuba.csv - L1517BOFF1-madcuba.csv spectra table: - L1517B-spectra.csv - L1517BOFF1-spectra.csv output files: RADEX results: radex-output-CH3OH.yaml RADEX parameters: CH3OH-A: MADCUBA name: CH3OH-A,vt=0-2 observed lines: ...
YAML
Unknown
1,378
[ascl:2302.022]
https://github.com/andresmegias/radex-line-fitter
examples/L1517B-HC3N.yaml
input files: MADCUBA table: - L1517B-madcuba.csv - L1517BOFF1-madcuba.csv spectra table: - L1517B-spectra.csv - L1517BOFF1-spectra.csv output files: RADEX results: radex-output-HC3N.yaml RADEX parameters: HC3N: MADCUBA name: HCCCN observed lines: frequen...
YAML
Unknown
820
[ascl:2302.022]
https://github.com/andresmegias/radex-line-fitter
examples/L1517B-CH3CN.yaml
input files: MADCUBA table: - L1517B-madcuba.csv - L1517BOFF1-madcuba.csv spectra table: - L1517B-spectra.csv - L1517BOFF1-spectra.csv output files: RADEX results: radex-output-CH3CN.yaml RADEX parameters: CH3CN: MADCUBA name: CH3CN observed lines: frequ...
YAML
Unknown
848
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
CMakeLists.txt
cmake_minimum_required(VERSION 3.18) message("Using cmake policy CMP0104 NEW (CMAKE_CUDA_ARCHITECTURES must be set)") cmake_policy(SET CMP0104 NEW) project(RamsesGPU LANGUAGES CXX C) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_EXTENSIONS OFF) # custom cmake macros location list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURREN...
Text
null
12,771
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
README.md
**WARNING: This code is mostly deprecated. Have a look at [ppkMHD](https://github.com/pkestene/ppkMHD)** [![DOI](https://zenodo.org/badge/42436229.svg)](https://zenodo.org/badge/latestdoi/42436229) ![mhd_mri 200x200](https://github.com/pkestene/ramsesGPU/blob/master/doc/mhd_mri_3d_gpu_Pm4_Re25000_double.gif) [Magnet...
Markdown
null
2,618
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
Licence_CeCILL_V2-en.txt
CeCILL FREE SOFTWARE LICENSE AGREEMENT Notice This Agreement is a Free Software license agreement that is the result of discussions between its authors in order to ensure compliance with the two main principles guiding its drafting: * firstly, compliance with the principles governing the distribution ...
Text
null
21,097
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
autogen.sh
#! /bin/sh autoreconf -i -f -v
Shell
null
31
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
memory_footprint.py
# # Some helper function to compute required RAM memory # per GPU (1 GPU per MPI process) # # required memory space in MBytes for MHD run # def mem_in_MB(N): # return (180.0*8*(N+6)*(N+6)*(N+6)+710.0*8*(N+6)*(N+6))/1000000 def mem_in_MB(Nx,Ny,Nz): return (180.0*8*(Nx+6)*(Ny+6)*(Nz+6)+710.0*8*(Nx+6)*(Ny+6))/10...
Python
null
692
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
Licence_CeCILL_V2-fr.txt
CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL Avertissement Ce contrat est une licence de logiciel libre issue d'une concertation entre ses auteurs afin que le respect de deux grands principes pr�side � sa r�daction: * d'une part, le respect des principes de diffusion des logiciels libres: acc�s au cod...
Text
null
21,467
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
doc/main.h
/** * \file main.h * \brief Doxygen main page Documentation. * \author P. Kestener * * \defgroup test * * \mainpage * * \section Purpose Purpose * * RAMSES-GPU is a software package providing a C++/Cuda * implementation of several 2nd order numerical schemes for solving the Euler * equations (2d and 3D) on...
C/C++ Header
null
14,169
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
am/cudalt.py
#!/usr/bin/python # libtoolish hack: compile a .cu file like libtool does import sys import os lo_filepath = sys.argv[1] o_filepath = lo_filepath.replace(".lo", ".o") try: i = o_filepath.rindex("/") lo_dir = o_filepath[0:i+1] o_filename = o_filepath[i+1:] except ValueError: lo_dir = "" o_filename = o_filepath ...
Python
null
1,804
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/kelvin_helmholtz_gpu_2d_mhd_mpi.ini
# # Hydro 2D example parameter file; Kelvin-Helmholtz simulation # # see Athena test suite web page : # http://www.astro.princeton.edu/~jstone/Athena/tests/kh/kh.html # # In the GPU version, one must particularly care of numerical parameters like # smallr, smallc (especially when trace computations is involved). # # Co...
Config
null
1,440
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/mhd_kelvin_helmholtz_2d.ini
# # MHD 2D test parameter file; Kelvin-Helmholtz instability simulation # # see # http://www.astro.princeton.edu/~jstone/Athena/tests/kh/kh.html # [run] tend=0.5 noutput=1 nstepmax=10 [mesh] nx=256 ny=256 nz=1 # BoundaryConditionType : # BC_UNDEFINED=0 # BC_DIRICHLET=1 # BC_NEUMANN=2 # BC_PERIODIC=3 boundary_xmin=3 b...
Config
null
986
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/orszag-tang3d.ini
# # MHD 3D example parameter file; Orszag-Tang vortex test # # see http://www.astro.princeton.edu/~jstone/Athena/tests/orszag-tang/pagesource.html # # In the GPU version, one must particularly care of numerical parameters like # smallr, smallc. [run] tend=1.5 noutput=20 nstepmax=200 [mesh] nx=96 ny=96 nz=96 # Bounda...
Config
null
1,029
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/mhd_fieldloop2d.ini
# # MHD 2D test parameter file; field loop simulation # # T. Gardiner & J.M. Stone, "An unsplit Godunov method for ideal MHD # via constrined transport", JCP, 205, 509 (2005) # http://www.astro.princeton.edu/~jstone/Athena/tests/field-loop/Field-loop.html # [run] tend=0.5 noutput=1 nstepmax=10 [mesh] nx=256 ny=148 nz...
Config
null
1,073
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/implode3d_zslab.ini
# # Hydro 3D example parameter file; Hydrodynamical Implosion Test # # see the Athena test suite : # http://www.astro.princeton.edu/~jstone/Athena/tests/implode/Implode.html # [run] tend=10.0 noutput=10 nstepmax=200 #nlog=100 [mesh] nx=64 ny=64 nz=64 # BoundaryConditionType : # BC_UNDEFINED=0 # BC_DIRICHLET=1 # BC_N...
Config
null
869
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/kelvin_helmholtz_cpu_2d_mpi.ini
# # Hydro 2D example parameter file; Kelvin-Helmholtz simulation # # see Athena test suite web page : # http://www.astro.princeton.edu/~jstone/Athena/tests/kh/kh.html # # In the GPU version, one must particularly care of numerical parameters like # smallr, smallc (especially when trace computations is involved). # # Co...
Config
null
1,467
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/jet3d_gpu.ini
# # Hydro 3D example parameter file; jet simulation # # In the GPU version, one must particularly care of numerical parameters like # smallr, smallc (especially when trace computations is involved). # # Converted from a fortran namelist containing # various input parameters for HYDRO runs [run] tend=0.4 noutput=20 nst...
Config
null
993
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/mhd_fieldloop3d.ini
# # MHD 3D test parameter file; field loop simulation # # T. Gardiner & J.M. Stone, "An unsplit Godunov method for ideal MHD # via constrined transport", JCP, 205, 509 (2005) # http://www.astro.princeton.edu/~jstone/Athena/tests/field-loop/Field-loop.html # [run] tend=0.5 noutput=10 nstepmax=100 [mesh] nx=64 ny=32 nz...
Config
null
1,096
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/mhd_mri_3d_stratified_restart.ini
# # MHD 3D test parameter file; # Magneto-Rotational Instability simulation with shearing box border # conditions and isothermal equation of state. # # http://en.wikipedia.org/wiki/Magnetorotational_instability # http://www.scholarpedia.org/article/Magnetorotational_instability # [run] tend=630000 noutput=10 nstepmax...
Config
null
1,529
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/mhd_jet3d.ini
# # MHD 3D example parameter file; jet simulation # # This example allows to test the hydro part of the MHD solver (class # MHDRunGodunov), to compare with the pure hydro solver (class # HydroRunGodunov). # [run] tend=1.2 noutput=5 nstepmax=500 [mesh] nx=15 ny=15 nz=60 xmin=0.0 xmax=1.0 ymin=0.0 ymax=1.0 zmin=0.0...
Config
null
1,027
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/mhd_jet2d.ini
# # MHD 2D example parameter file; jet simulation # # This example allows to test the hydro part of the MHD solver (class # MHDRunGodunov), to compare with the pure hydro solver (class # HydroRunGodunov). # [run] tend=1.2 noutput=10 nstepmax=1000 [mesh] nx=200 ny=200 nz=1 xmin=0.0 xmax=1.0 ymin=0.0 ymax=1.0 # Bou...
Config
null
972
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/mhd_mri_3d.ini
# # MHD 3D test parameter file; # Magneto-Rotational Instability simulation with shearing box border # conditions and isothermal equation of state. # # http://en.wikipedia.org/wiki/Magnetorotational_instability # http://www.scholarpedia.org/article/Magnetorotational_instability # [run] tend=630000 noutput=500 nstepma...
Config
null
1,265
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/kelvin_helmholtz_gpu_2d.ini
# # Hydro 2D example parameter file; Kelvin-Helmholtz simulation # # see Athena test suite web page : # http://www.astro.princeton.edu/~jstone/Athena/tests/kh/kh.html # # In the GPU version, one must particularly care of numerical parameters like # smallr, smallc (especially when trace computations is involved). # # Co...
Config
null
1,545
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/jet2d_mpi_gpu.ini
# # Hydro 2D example parameter file; jet simulation in MPI+GPU environment # # In the GPU version, one must particularly care of numerical parameters like # smallr, smallc (especially when trace computations is involved). # # Converted from a fortran namelist containing # various input parameters for HYDRO runs [run] ...
Config
null
1,147
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/implode3d_mpi_zslab.ini
# # Hydro 3D example parameter file; Hydrodynamical Implosion Test # # see the Athena test suite : # http://www.astro.princeton.edu/~jstone/Athena/tests/implode/Implode.html # [run] tend=0.4 noutput=10 nstepmax=100 # define a 3D MPI cartesian mesh with mx x my x mz MPI processes [mpi] mx=2 my=2 mz=1 [mesh] nx=48 ny...
Config
null
956
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/jet2d_mhd_mpi_cpu.ini
# # MHD 2D example parameter file; jet simulation # # Converted from a fortran namelist containing # various input parameters for HYDRO runs [run] tend=0.4 noutput=50 nstepmax=2000 # define a 2D MPI cartesian mesh with mx x my MPI processes [mpi] mx=2 my=2 mz=1 # define the 2D problem for each MPI process [mesh] nx=...
Config
null
1,127
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/Keplerian_disk2d.ini
# # Hydro 2D example parameter file: Keplerian disk test # # see # http://arxiv.org/pdf/1409.7395v1.pdf - section 4.2.4 # http://www.cfd-online.com/Wiki/Gresho_vortex [run] tend=1.5 noutput=10 nstepmax=5000 nlog=100 [mesh] nx=128 ny=128 nz=1 xmin=-2.5 xmax=2.5 ymin=-2.5 ymax=2.5 zmin=-2.5 zmax=2.5 # BoundaryCondit...
Config
null
990
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/kelvin_helmholtz_cpu_2d.ini
# # Hydro 2D example parameter file; Kelvin-Helmholtz simulation # # see Athena test suite web page : # http://www.astro.princeton.edu/~jstone/Athena/tests/kh/kh.html # # Converted from a fortran namelist containing # various input parameters for HYDRO runs [run] tend=0.2 noutput=50 nstepmax=5000 [mesh] nx=400 ny=400...
Config
null
1,281
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/hydro_sod2d.ini
# # Hydro 2D example parameter file; Sod shock tube test # # [run] tend=0.4 noutput=100 nstepmax=9000 [mesh] nx=128 ny=128 nz=1 # BoundaryConditionType : # BC_UNDEFINED=0 # BC_DIRICHLET=1 # BC_NEUMANN=2 # BC_PERIODIC=3 boundary_xmin=1 boundary_xmax=1 boundary_ymin=1 boundary_ymax=1 boundary_zmin=1 boundary_zmax=1 [...
Config
null
651
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/implode3d.ini
# # Hydro 3D example parameter file; Hydrodynamical Implosion Test # # see the Athena test suite : # http://www.astro.princeton.edu/~jstone/Athena/tests/implode/Implode.html # [run] tend=0.4 noutput=20 nstepmax=400 [mesh] nx=64 ny=64 nz=64 # BoundaryConditionType : # BC_UNDEFINED=0 # BC_DIRICHLET=1 # BC_NEUMANN=2 #...
Config
null
804
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/riemann2d.ini
# # Hydro 2D example parameter file; 2D Riemann problem initialization # [run] tend=0.2 noutput=100 nstepmax=2000 [mesh] nx=400 ny=400 nz=1 # BoundaryConditionType : # BC_UNDEFINED=0 # BC_DIRICHLET=1 # BC_NEUMANN=2 # BC_PERIODIC=3 boundary_xmin=2 boundary_xmax=2 boundary_ymin=2 boundary_ymax=2 boundary_zmin=2 bounda...
Config
null
790
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/implode2d.ini
# # Hydro 2D example parameter file; Hydrodynamical Implosion Test # # see the Athena test suite : # http://www.astro.princeton.edu/~jstone/Athena/tests/implode/Implode.html # [run] tend=0.4 noutput=100 nstepmax=9000 [mesh] nx=400 ny=400 nz=1 # BoundaryConditionType : # BC_UNDEFINED=0 # BC_DIRICHLET=1 # BC_NEUMANN=2...
Config
null
771
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/rayleigh_taylor_gpu_3d.ini
# # Hydro 3D example parameter file; Rayleigh-Taylor simulation # # see Athena test suite web page : # http://www.astro.princeton.edu/~jstone/Athena/tests/rt/rt.html # # In the GPU version, one must particularly care of numerical parameters like # smallr, smallc (especially when trace computations is involved). # # Con...
Config
null
1,301
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/falling_bubble_gpu_2d.ini
# # Hydro 2D example parameter file; falling bubble simulation # # In the GPU version, one must particularly care of numerical parameters like # smallr, smallc (especially when trace computations is involved). # [run] tend=50 noutput=200 nstepmax=60000 [mesh] nx=200 ny=200 nz=1 xmin=0.0 xmax=1.0 ymin=0.0 ymax=1.0 # B...
Config
null
1,064
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/turbulence_mhd_ou.ini
# # 3D MHD turbulence example parameter file # # Forcing term generated with Ornstein-Uhlenbeck process # [run] tend=1000.0 noutput=10 nstepmax=100 nlog=1000 [mesh] nx=32 ny=32 nz=32 xmin=0 xmax=1 ymin=0 ymax=1 zmin=0 zmax=1 # BoundaryConditionType : # BC_UNDEFINED=0 # BC_DIRICHLET=1 # BC_NEUMANN=2 # BC_PERIODIC=3 ...
Config
null
1,159
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/mhd_currentSheet_2d.ini
# # MHD 2D test parameter file; current sheet test # # http://www.astro.princeton.edu/~jstone/Athena/tests/current-sheet/current-sheet.html # [run] tend=0.5 noutput=1 nstepmax=10 [mesh] nx=100 ny=100 nz=1 # BoundaryConditionType : # BC_UNDEFINED=0 # BC_DIRICHLET=1 # BC_NEUMANN=2 # BC_PERIODIC=3 boundary_xmin=3 bounda...
Config
null
955
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/implode2d_mpi.ini
# # Hydro 2D example parameter file; Hydrodynamical Implosion Test # # see the Athena test suite : # http://www.astro.princeton.edu/~jstone/Athena/tests/implode/Implode.html # [run] tend=0.4 noutput=10 nstepmax=100 # define a 2D MPI cartesian mesh with mx x my MPI processes [mpi] mx=2 my=2 mz=1 [mesh] nx=100 ny=100...
Config
null
894
[ascl:1710.013]
https://github.com/pkestene/ramsesGPU
data/blast2d_mpi.ini
# # Hydro 2D example parameter file: Spherical Blast wave # # see Athena test suite : # http://www.astro.princeton.edu/~jstone/Athena/tests/blast/blast.html # [run] tend=0.4 noutput=10 nstepmax=200 # define a 2D MPI cartesian mesh with mx x my MPI processes [mpi] mx=2 my=2 mz=1 [mesh] nx=50 ny=75 nz=1 xmin=0.0 xm...
Config
null
994