text
stringlengths
185
73.3k
repo
stringlengths
7
100
path
stringlengths
4
146
language
stringclasses
7 values
hash
stringlengths
16
16
score
float64
7
8.5
stars
int64
0
237k
"""update the requirement source source title Revision ID: 6edfa48316d0 Revises: 94d773680c08 Create Date: 2025-08-11 09:54:14.903883 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '6edfa48316d0' down_revision = '94d773680c08' branch_labels = None depends_on =...
bcgov/EPIC.compliance
compliance-api/migrations/versions/6edfa48316d0_update_the_requirement_source_source_.py
.py
a543247838f4ced8
7.24
2
"""case file tables Revision ID: 774870c99c95 Revises: f9a414e34ea4 Create Date: 2024-08-15 15:54:35.140278 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '774870c99c95' down_revision = 'f9a414e34ea4' branch_labels = None depends_on = None def upgrade(): ...
bcgov/EPIC.compliance
compliance-api/migrations/versions/774870c99c95_case_file_tables.py
.py
bf0fc05df015ff85
7.24
2
# Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.generic import Package from spack.package import * import glob class DunePardata(Package): """FIXME: Put a proper description of your package here.""" ...
DUNE/dune_spack
spack_repo/dune_spack/packages/dune_pardata/package.py
.py
8a28310a04bba682
7
0
# This package.py written by Liam O'Sullivan <liam.osullivan@uni-mainz.de> # For reasons™, explicitly including root and geant4 as dependencies # causes the build to fail (missing blas or whatevs). # If you spack load root and geant4 it builds fine though. from spack_repo.builtin.build_systems.cmake import CMakePackag...
DUNE/dune_spack
spack_repo/dune_spack/packages/dune_tms/package.py
.py
b8c085daa4c09488
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Duneanaobj(CM...
DUNE/dune_spack
spack_repo/dune_spack/packages/duneanaobj/package.py
.py
9d9b76ca70ba0486
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Dunecalib(CMakePackage...
DUNE/dune_spack
spack_repo/dune_spack/packages/dunecalib/package.py
.py
0901a26de11100bd
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.generic import Package from spack.package import * class Dunedaqdataformats(Packa...
DUNE/dune_spack
spack_repo/dune_spack/packages/dunedaqdataformats/package.py
.py
9ac74691d3e7ee64
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Dunedataprep(CMakePack...
DUNE/dune_spack
spack_repo/dune_spack/packages/dunedataprep/package.py
.py
a0314a3687ed4f31
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.generic import Package from spack.package import * class Dunedetdataformats(Packag...
DUNE/dune_spack
spack_repo/dune_spack/packages/dunedetdataformats/package.py
.py
0e93667096fec0f4
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Duneexamples(CMakePack...
DUNE/dune_spack
spack_repo/dune_spack/packages/duneexamples/package.py
.py
c5d86d9ccb0fe975
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Dunepdlegacy(CMakePack...
DUNE/dune_spack
spack_repo/dune_spack/packages/dunepdlegacy/package.py
.py
052f0549c99f0b7d
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Duneprototypes(CMakePa...
DUNE/dune_spack
spack_repo/dune_spack/packages/duneprototypes/package.py
.py
60813f837f2baac3
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Dunesim(CMakePackage):...
DUNE/dune_spack
spack_repo/dune_spack/packages/dunesim/package.py
.py
18cc7500d9caa6a8
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * DUNE_PARDATA_DIR = "/cvmfs/d...
DUNE/dune_spack
spack_repo/dune_spack/packages/dunesw/package.py
.py
8a465c658d17da68
7
0
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Duneutil(CMakePackage)...
DUNE/dune_spack
spack_repo/dune_spack/packages/duneutil/package.py
.py
89bcdd1bbe9640ce
7
0
# This package.py written by Liam O'Sullivan <liam.osullivan@uni-mainz.de> # For reasons™, explicitly including root and geant4 as dependencies # causes the build to fail (missing blas or whatevs). # If you spack load root and geant4 it builds fine though. from spack_repo.builtin.build_systems.cmake import CMakePackag...
DUNE/dune_spack
spack_repo/dune_spack/packages/edep_sim/package.py
.py
d5dab59184bd9fe0
7
0
"""API client for Phoenix-Bad Ottobrunn.""" from __future__ import annotations import asyncio import logging import re import aiohttp from bs4 import BeautifulSoup _LOGGER = logging.getLogger(__name__) # API endpoints POOL_URL = ( "https://phoenixbad.de/wp-admin/admin-ajax.php?action=updateLiveVisitors&area=Ba...
FaserF/ha-phoenixbad
custom_components/phoenix_bad/api.py
.py
f1fe8dcb8ac45c5a
7
0
"""Config flow for Phönix-Bad Ottobrunn.""" from __future__ import annotations import homeassistant.helpers.config_validation as cv from homeassistant import config_entries from .const import DOMAIN CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) class PhoenixBadConfigFlow(config_entries.ConfigFlow, do...
FaserF/ha-phoenixbad
custom_components/phoenix_bad/config_flow.py
.py
f1362fb3b8d4d664
7
0
"""DataUpdateCoordinator for Phoenix-Bad.""" from __future__ import annotations import logging from datetime import timedelta import aiohttp from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from .api import OccupancyData, PhoenixBa...
FaserF/ha-phoenixbad
custom_components/phoenix_bad/coordinator.py
.py
52afd5f7a5f90f42
7
0
"""Sensor platform for Phoenix-Bad Ottobrunn.""" import logging from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.up...
FaserF/ha-phoenixbad
custom_components/phoenix_bad/sensor.py
.py
fcf3c4be6f12b4cd
7
0
"""Tests for Phoenix-Bad API client.""" import pytest from custom_components.phoenix_bad.api import PhoenixBadApiClient, PhoenixBadParseError def test_parse_response_success(): """Test successful parsing of HTML response.""" html = '<div class="outer_wrapper" data-free="10"><div class="inner_wrapper" style=...
FaserF/ha-phoenixbad
tests/test_api.py
.py
bb22694551f2ac95
7.5
0
"""Test that all translation keys are present in EN and DE.""" import json from pathlib import Path import pytest INTEGRATION_DIR = next( p for p in (Path(__file__).resolve().parent.parent / "custom_components").iterdir() if p.is_dir() and p.name != "__pycache__" ) STRINGS_FILE = INTEGRATION_DIR / "strin...
FaserF/ha-phoenixbad
tests/test_translations.py
.py
653f2cc5228e0493
7.5
0
""" This file serves as compatibility layer between this limnd2 library maintained by Laboratory Imaging s.r.o. (https://github.com/Laboratory-Imaging/limnd2) and nd2 library maintained by Talley Lambert (https://github.com/tlambert03/nd2) It copies the interface of nd2 library, but uses limnd2 library on the "backend"...
Laboratory-Imaging/limnd2
src/limnd2/nd2_compatability/nd2file_types.py
.py
c4f783a1e16ea844
7.3
3
from __future__ import annotations from abc import ABC, abstractmethod import copy import json from pathlib import Path from copy import deepcopy from dataclasses import is_dataclass, asdict import re import warnings import numpy as np import sys from limnd2.attributes import ImageAttributes from typing import TYPE_...
Laboratory-Imaging/limnd2
src/limnd2/tools/conversion/LimImageSource.py
.py
9cc2ffbf0b9e203f
7.3
3
"""Reusable checkpoint storage for expensive experimental evidence jobs. Timestamped ``evidence_jobs`` directories are immutable execution records. This module provides a separate, stable cache for expensive numerical payloads that can be validated and reused by later attempts. The cache key describes the scientific...
tanlin2013/qlinks
experimental/jobs/evidence_cache.py
.py
3155790c478fbcdc
7.15
1
from __future__ import annotations from dataclasses import dataclass from itertools import product from typing import Iterable import numpy as np import numpy.typing as npt from qlinks.variables import ConfigEncoder, VariableLayout def full_basis_from_layout( layout: VariableLayout, *, sort: bool = Tru...
tanlin2013/qlinks
qlinks/basis/basis.py
.py
0573be331465ca1e
7.15
1
from __future__ import annotations from typing import Any import numpy as np from numpy._typing import NDArray def basis_configs_from_basis(basis: Any) -> NDArray[np.integer]: """Return explicit basis configurations for ArrayBasis or BinaryEncodedBasis. Sparse/array builders usually expose this as ``basis....
tanlin2013/qlinks
qlinks/basis/configs.py
.py
ddcb2d133d5bb414
7.15
1
from __future__ import annotations from dataclasses import dataclass from typing import Protocol, Sequence from qlinks.basis.basis import Basis from qlinks.constraints import Constraint, ConstraintCollection, SectorCondition from qlinks.variables import VariableLayout class BasisSolver(Protocol): """Protocol im...
tanlin2013/qlinks
qlinks/basis/solvers/base.py
.py
7c4e42cff4ab8f79
7.15
1
from __future__ import annotations from dataclasses import dataclass from itertools import product from typing import Sequence import numpy as np from qlinks.basis.basis import Basis from qlinks.constraints import Constraint, SectorCondition, all_satisfied from qlinks.variables import VariableLayout @dataclass(fro...
tanlin2013/qlinks
qlinks/basis/solvers/brute_force.py
.py
0aff82ee03bbb382
7.15
1
class CustomStep: """This class helps you perform operations on a SAS Studio Custom Step programmatically""" def __init__(self, custom_step_file:str = None, name: str =None, creationTimeStamp=None, modifiedTimeStamp=None, createdBy: str=None, modifiedBy: str =None, displayName...
SundareshSankaran/py-sas-studio-custom-steps
src/py_sas_studio_custom_steps/custom_step.py
.py
cc0cd99fc35230e0
7.15
1
#!/usr/bin/env python3 """Verification hook — runs after every Edit/Write/MultiEdit and feeds failures back. Adopted from agent-ready-projects v1.14.0 ("Verification Hooks"). The point is who carries the error message: without this, the agent edits, stops, and waits for a human to run the tests and paste the failure b...
ducroq/energydatahub
.claude/hooks/verify_edit.py
.py
1de87c36d51968ba
7
0
""" EnergyZero API Collector ------------------------- Collects energy prices from EnergyZero API using the new base collector architecture. File: collectors/energyzero.py Created: 2025-10-25 Author: Energy Data Hub Project Description: Implements BaseCollector for EnergyZero data. Handles real-time and day-a...
ducroq/energydatahub
collectors/energyzero.py
.py
a502d1a343afd9c8
7
0
""" ENTSOG Gas Flows Collector -------------------------- Fetches European gas flow data from the ENTSOG Transparency Platform. File: collectors/entsog_flows.py Created: 2025-01-19 Description: Collects gas flow data from ENTSOG (European Network of Transmission System Operators for Gas) Transparency Platform...
ducroq/energydatahub
collectors/entsog_flows.py
.py
0876e8513b88ecc1
7
0
""" EPEX SPOT Market Collector ---------------------------- Collects day-ahead energy prices from EPEX SPOT market via Awattar API using the new base collector architecture. File: collectors/epex.py Created: 2025-10-25 Author: Energy Data Hub Project Description: Implements BaseCollector for EPEX SPOT data. Handl...
ducroq/energydatahub
collectors/epex.py
.py
1a7f15b0df0d8893
7
0
""" Backfill missing ENTSO-E price data into existing energy_price_forecast files. Scans all timestamped price files, identifies those missing 'entsoe' (NL) and/or 'entsoe_de' (DE) datasets, fetches historical prices from the ENTSO-E API, and merges them back into the encrypted files. Usage: python scripts/backfi...
ducroq/energydatahub
scripts/backfill_entsoe.py
.py
8e1d8db4008a2e4f
7
0
""" Backfill broken gas storage timestamps in historical data files. A bug in pd.concat(ignore_index=True) caused GIE storage data to lose its gasDayStart index, resulting in integer keys ('0', '1', '2') instead of ISO timestamps. The data values are intact; only the keys need reconstruction using metadata start_time ...
ducroq/energydatahub
scripts/backfill_gas_storage.py
.py
4fe4033ac8484352
7
0
""" Command-line interface for CartoSym Transcoder. """ import argparse import json import sys from pathlib import Path from typing import Optional from antlr4 import CommonTokenStream, FileStream from jsonschema import ValidationError from jsonschema import validate as jsonschema_validate from cartosym_transcoder.g...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/cli.py
.py
0c60b81b54132d79
7.15
1
""" Abstract base class for format codecs. Each codec provides a reader (format → Style) and a writer (Style → format). """ from abc import ABC, abstractmethod from pathlib import Path from typing import Any, List, Union from ..models.styles import Style class CodecReader(ABC): """Abstract reader: converts a s...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/base.py
.py
ca2768f18a0dbd1e
7.15
1
""" CSCSS reader — parse CartoSym-CSS files into Style models. Delegates to the existing :class:`~cartosym_transcoder.parser.CartoSymParser`. """ from pathlib import Path from typing import Union from ...models.styles import Style from ...parser import CartoSymParser from ..base import CodecReader class CscssReade...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/cscss/reader.py
.py
b7b08072b263ff77
7.15
1
""" CSCSS writer — serialise Style models to CartoSym-CSS text. Delegates to :meth:`~cartosym_transcoder.converter.Converter.style_to_cscss`. """ from ...converter import Converter from ...models.styles import Style from ..base import CodecWriter class CscssWriter(CodecWriter): """Write a Style model as ``.cscs...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/cscss/writer.py
.py
9520d84c4111b788
7.15
1
""" CS-JSON reader — parse CartoSym-JSON files into Style models. Delegates to :meth:`~cartosym_transcoder.converter.Converter.csjson_to_style`. """ from pathlib import Path from typing import Union from ...converter import Converter from ...models.styles import Style from ..base import CodecReader class CsjsonRea...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/csjson/reader.py
.py
644a905ecfa068fe
7.15
1
""" CS-JSON writer — serialise Style models to CartoSym-JSON. Delegates to :meth:`~cartosym_transcoder.converter.Converter.cscss_to_csjson` (which accepts a Style model directly and produces a validated dict). """ import json from typing import Any, Union from ...converter import Converter from ...models.styles impo...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/csjson/writer.py
.py
b5521a82b48eff8f
7.15
1
""" MapLibre / MapBox GL Style reader — parse MapLibre style JSON into Style models. .. note:: This is a **stub**. Implementation is tracked in ROADMAP §3.4. """ from pathlib import Path from typing import Union from ...models.styles import Style from ..base import CodecReader class MaplibreReader(CodecReader):...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/maplibre/reader.py
.py
0e4b6543745826a7
7.15
1
""" MapLibre / MapBox GL Style writer — serialise Style models to MapLibre style JSON. .. note:: This is a **stub**. Implementation is tracked in ROADMAP §3.4. """ from ...models.styles import Style from ..base import CodecWriter class MaplibreWriter(CodecWriter): """Write a Style model as MapLibre / MapBox ...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/maplibre/writer.py
.py
6593954ad2932dcd
7.15
1
""" Scalar formatting conventions for the SLD/SE codec. SLD/SE ``se:SvgParameter`` values and XML attributes are bare numeric/hex strings — unlike CartoSym's ``{unit: value}`` dict convention for :class:`~cartosym_transcoder.models.types.UnitValue`, SE 1.1.0 core has no unit-of-measure attribute on these parameters, s...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/sld_se/_types.py
.py
f6d3ea62b0481e8c
7.15
1
""" XML namespace constants and small ``lxml`` element-building helpers shared by :mod:`_filter`, :mod:`_symbolizer`, :mod:`reader`, and :mod:`writer`. """ from typing import Optional from lxml import etree SLD_NS = "http://www.opengis.net/sld" SE_NS = "http://www.opengis.net/se" OGC_NS = "http://www.opengis.net/ogc...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/sld_se/_xml_helpers.py
.py
3180346f2fd9fa08
7.15
1
""" SLD/SE reader — parse OGC Styled Layer Descriptor / Symbology Encoding XML into Style models. Scope: vector symbolizers plus basic Part-1 raster/coverage styling. See ``writer.py``'s module docstring and ``docs/sld_se_mapping_issues.md`` for the exact scope boundary. Out-of-scope SLD/SE constructs (e.g. advanced r...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/codecs/sld_se/reader.py
.py
845a70400d15b17e
7.15
1
""" CQL2-JSON serialisation — conversion between expression models and CQL2-JSON dicts. The CQL2-JSON serialisation is currently handled by: * **Serialisation** (model → JSON dict): methods on the expression model classes (``to_cql2_json()``) and the ``ast_converter._convert_expression_to_json_selector()``. * **Des...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/expressions/cql2_json.py
.py
591c21d4b10758a0
7.15
1
""" CQL2-Text serialisation — write-back of expressions to CQL2-Text syntax. The CQL2-Text write-back logic is currently implemented inline in :meth:`~cartosym_transcoder.converter.Converter._format_selector_expr`. This module provides a public entry-point that delegates to that method. """ from typing import Any fr...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/expressions/cql2_text.py
.py
a88b2769a28276bc
7.15
1
""" Base Pydantic models and utilities for CartoSym. """ from abc import ABC from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel, ConfigDict, Field class BaseCartoSymModel(BaseModel): """ Base class for all CartoSym models. Provides common configuration and utilities for ...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/models/base.py
.py
38d1308dbcf7ab65
7.15
1
""" Core style and rule models for CartoSym. Based on the JSON Schema definitions for style, stylingRule, and metadata. """ from typing import Any, Dict, List, Optional, Union from pydantic import Field, field_validator, model_validator from .base import BaseCartoSymModel, CommentMixin # Import symbolizers from .s...
maxcollombin/CartoSymTranscoder
src/cartosym_transcoder/models/styles.py
.py
7437477a237148f6
7.15
1
from pathlib import Path from typing import Any from mlrepromutate.engine.runner import ExecutionResult, ExperimentRunner from mlrepromutate.engine.sandbox import ProjectSandbox from mlrepromutate.models import ( MutationCandidate, MutationOutcome, MutationResult, ) from mlrepromutate.operators.base import...
ilyuka/MLReproMutate
src/mlrepromutate/engine/evaluator.py
.py
001782881f4dd9c0
7
0
from dataclasses import dataclass, field from enum import StrEnum from pathlib import Path from typing import Any class MutationOutcome(StrEnum): """Possible outcomes of evaluating a mutation.""" KILLED = "killed" SURVIVED = "survived" INVALID = "invalid" EQUIVALENT = "equivalent" TIMEOUT = "...
ilyuka/MLReproMutate
src/mlrepromutate/models.py
.py
c81999ca8bcf5928
7
0
from abc import ABC, abstractmethod from collections.abc import Iterable from pathlib import Path from mlrepromutate.models import MutationCandidate class MutationOperator(ABC): """Base interface for reproducibility mutation operators.""" @property @abstractmethod def name(self) -> str: """R...
ilyuka/MLReproMutate
src/mlrepromutate/operators/base.py
.py
396bc21f93052289
7
0
import googlemaps from googlemaps.exceptions import ApiError, TransportError from config import GEOCODING_API_KEY class SearchLocal: def __init__(self, latitude: float, longitude: float): self.gmaps = googlemaps.Client(key=GEOCODING_API_KEY) self.latitude = latitude self.longitude = longit...
DoctorSolo/Geocode-Aplication-Google-Cloud
src/SearchLocal.py
.py
bc8ded484b6fd7cc
7.15
1
"""Demonstration of Advanced Acquisition Strategies. This script demonstrates that Phase 2 acquisition functions work as intended: - BALD: Selects samples with high mutual information - Core-Set: Selects diverse samples covering the embedding space - BatchBALD/DPP: Selects diverse batches avoiding redundancy - EGL: Se...
HFooladi/molax
examples/acquisition_strategies_demo.py
.py
5eb473c0ec329af6
7.15
1
"""Active Learning Benchmark - Efficient jraph implementation. Compares acquisition strategies: - Random sampling (baseline) - Uncertainty sampling (MC dropout variance) - Combined uncertainty + Core-Set diversity Key optimization: Batch all data once, use masking for active learning. This avoids JIT recompilation an...
HFooladi/molax
examples/active_learning_benchmark.py
.py
0484aa4f3f5c93fd
7.15
1
"""Calibration Comparison: MC Dropout vs Ensemble vs Evidential. This example demonstrates the calibration metrics module by: 1. Training three model types on ESOL dataset 2. Computing calibration metrics for each 3. Visualizing reliability diagrams 4. Applying temperature scaling for post-hoc calibration The example...
HFooladi/molax
examples/calibration_comparison.py
.py
d87127370c70197d
7.15
1
"""Efficient active learning with jraph - fixed batch approach. Key insight: Batch ALL training data once, use index masking for active learning. This avoids JIT recompilation from changing shapes. Protocol note: the model is re-initialized at the start of every acquisition round. Warm-starting one model across round...
HFooladi/molax
examples/simple_active_learning.py
.py
3f0d20548fa6679b
7.15
1
"""Batch-aware acquisition functions for active learning. These methods consider interactions between samples in a batch to select diverse, informative batches rather than independently selecting top samples. Includes: - BatchBALD: Greedy selection maximizing joint mutual information - DPP: Determinantal Point Proces...
HFooladi/molax
molax/acquisition/batch_aware.py
.py
ab70aaa061e494f3
7.15
1
"""Core-Set selection for active learning. Core-Set selection uses k-center greedy algorithm in the model's embedding space to select a diverse and representative subset of samples. This approach aims to minimize the maximum distance from any point to its nearest selected point, providing good coverage of the data dis...
HFooladi/molax
molax/acquisition/coreset.py
.py
0394f12a08e3263e
7.15
1
"""Expected Model Change acquisition functions. Expected Gradient Length (EGL) selects samples that would cause the largest change in model parameters if labeled. This is approximated by computing the gradient of the loss with respect to model parameters for each sample, using the model's prediction as a pseudo-label....
HFooladi/molax
molax/acquisition/expected_change.py
.py
8651a361f84edc7d
7.15
1
"""Deep Ensemble models for improved uncertainty quantification. Deep Ensembles train N independent models with different random initializations. Uncertainty is estimated via prediction disagreement (epistemic) plus average predicted variance (aleatoric). Reference: Lakshminarayanan et al., "Simple and Scalable Predi...
HFooladi/molax
molax/models/ensemble.py
.py
b4aafc6de21abaaf
7.15
1
"""Graph Attention Networks using jraph for efficient batched processing. GAT uses learned attention weights to dynamically weight neighbor contributions, enabling adaptive aggregation based on node relevance. """ from dataclasses import dataclass from typing import Sequence, Tuple import flax.nnx as nnx import jax....
HFooladi/molax
molax/models/gat.py
.py
159d6a4ca930059e
7.15
1
"""Message Passing Neural Networks using jraph for efficient batched processing. MPNN extends GCN by incorporating edge features in the message computation, enabling the model to leverage bond information for molecular property prediction. """ from dataclasses import dataclass from typing import Literal, Sequence, Tu...
HFooladi/molax
molax/models/mpnn.py
.py
c35fde4feacfb8a3
7.15
1
"""Data utilities for molecular graph datasets using jraph for efficient batching.""" from pathlib import Path from typing import List, Optional, Tuple, Union import jax.numpy as jnp import jraph import numpy as np import pandas as pd from rdkit import Chem from .featurizers import DEFAULT_FEATURIZER, get_atom_featu...
HFooladi/molax
molax/utils/data.py
.py
0606ccd881d26682
7.15
1
"""Atom featurizers for converting RDKit atoms to node feature vectors. Two featurizers are registered: - ``"basic"`` (default): six raw descriptor values. Kept as the default so that existing code and saved configurations keep working unchanged. - ``"rich"``: 29-dimensional one-hot encoding. Raw descriptors span v...
HFooladi/molax
molax/utils/featurizers.py
.py
16d535cb573f6b0a
7.15
1
import datetime import logging import sys from pathlib import Path from typing import Optional def setup_logger( name: str = "molax", log_level: int = logging.INFO, log_file: Optional[str] = None, console_output: bool = True, ) -> logging.Logger: """Set up a logger with both file and console handl...
HFooladi/molax
molax/utils/logger.py
.py
73ea275b8c740496
7.15
1
"""Tests for acquisition functions using jraph graphs.""" import jax.numpy as jnp import pytest from molax.acquisition import ( combined_acquisition, diversity_sampling, uncertainty_sampling, ) from molax.models.gcn import GCNConfig, UncertaintyGCN from molax.utils.data import smiles_to_jraph @pytest.fi...
HFooladi/molax
tests/test_acquisition.py
.py
a453699ff007e611
7.65
1
"""Tests for BALD acquisition functions.""" import flax.nnx as nnx import jax.numpy as jnp import pytest from molax.acquisition.bald import ( bald_sampling, ensemble_bald_sampling, evidential_bald_sampling, ) from molax.models.ensemble import DeepEnsemble, EnsembleConfig from molax.models.evidential impor...
HFooladi/molax
tests/test_bald.py
.py
71f5d41c60236c61
7.65
1
"""Tests for calibration metrics and visualization.""" import jax.numpy as jnp import matplotlib import matplotlib.pyplot as plt import numpy as np import pytest from molax.metrics import ( TemperatureScaling, calibration_error_per_sample, compute_calibration_curve, create_calibration_report, eval...
HFooladi/molax
tests/test_calibration.py
.py
b78c650098721a5e
7.65
1
"""Tests for Core-Set acquisition functions.""" import flax.nnx as nnx import jax import jax.numpy as jnp import pytest from molax.acquisition.coreset import ( coreset_from_embeddings, coreset_sampling, coreset_sampling_with_scores, ) from molax.models.ensemble import DeepEnsemble, EnsembleConfig from mol...
HFooladi/molax
tests/test_coreset.py
.py
b719e3018fa9f71a
7.65
1
"""Tests for Deep Ensemble models.""" import flax.nnx as nnx import jax.numpy as jnp import jraph import pytest from molax.models.ensemble import ( DeepEnsemble, EnsembleConfig, create_ensemble_optimizers, eval_ensemble_step, get_ensemble_uncertainties, train_ensemble_step, ) from molax.models...
HFooladi/molax
tests/test_ensemble.py
.py
519e14246b8fa2d1
7.65
1
"""Tests for Evidential Deep Learning models.""" import flax.nnx as nnx import jax.numpy as jnp import jraph import pytest from molax.models.evidential import ( EvidentialConfig, EvidentialGCN, EvidentialHead, create_evidential_optimizer, eval_evidential_step, evidential_loss, get_evidenti...
HFooladi/molax
tests/test_evidential.py
.py
8917a4c3d8946f70
7.65
1
"""Tests for Expected Gradient Length acquisition functions.""" import flax.nnx as nnx import jax.numpy as jnp import pytest from molax.acquisition.expected_change import ( egl_acquisition, egl_sampling, egl_sampling_batched, ) from molax.models.gcn import GCNConfig, UncertaintyGCN from molax.utils.data i...
HFooladi/molax
tests/test_expected_change.py
.py
170b63899ea8fc5a
7.65
1
"""Tests for atom featurizers and their integration with smiles_to_jraph.""" import jax.numpy as jnp import pytest from rdkit import Chem from molax.utils.data import MolecularDataset, batch_graphs, smiles_to_jraph from molax.utils.featurizers import ( ATOM_FEATURIZERS, DEFAULT_FEATURIZER, get_atom_featur...
HFooladi/molax
tests/test_featurizers.py
.py
412fed044255022e
7.65
1
"""Guardrails against Flax NNX API drift. molax targets the Flax NNX API as of flax>=0.12 (verified against flax 0.12.2 / jax 0.9.0 / optax 0.2.6). The patterns asserted here are the ones that have already changed once in NNX's history and would otherwise break silently in an example script rather than loudly in CI. "...
HFooladi/molax
tests/test_flax_compat.py
.py
206f3c305faea758
7.65
1
"""Make Resource.resource_definition_accession_id nullable. Revision ID: 3a1fe0851e06 Revises: Create Date: 2025-11-10 18:42:40.749914 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "3a1fe0851e06" down_revision: str ...
maraxen/praxis
.agent/backups/alembic_20260121/versions/3a1fe0851e06_make_resourceorm_resource_definition_.py
.py
271983bcf1dbbda6
7.35
4
"""Remove unique constraint from name in PLR definitions. Revision ID: 577d92edf9a5 Revises: 3a1fe0851e06 Create Date: 2025-12-21 12:48:00.000000 """ from collections.abc import Sequence from alembic import op # revision identifiers, used by Alembic. revision: str = "577d92edf9a5" down_revision: str | Sequence[str]...
maraxen/praxis
.agent/backups/alembic_20260121/versions/577d92edf9a5_remove_unique_from_name.py
.py
b2c80e157f6c6c93
7.35
4
"""add properties_json to resource_definition. Revision ID: a7f3e8c9d2b1 Revises: cd193888759e Create Date: 2025-12-22 """ from collections.abc import Sequence import sqlalchemy as sa from sqlalchemy.dialects import postgresql from alembic import op # revision identifiers, used by Alembic. revision: str = "a7f3e8c...
maraxen/praxis
.agent/backups/alembic_20260121/versions/a7f3e8c9d2b1_add_properties_json_to_resource_definition.py
.py
0e5181e3223d621c
7.35
4
"""add deck_layout_path to function_protocol_definitions. Revision ID: b8c4d5e6f7a2 Revises: a7f3e8c9d2b1 Create Date: 2026-01-02 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "b8c4d5e6f7a2" down_revision: str | None...
maraxen/praxis
.agent/backups/alembic_20260121/versions/b8c4d5e6f7a2_add_deck_layout_path_to_protocol_defs.py
.py
be1ee16e60c1f7b2
7.35
4
"""add_maintenance_and_location_columns Revision ID: bb6b6f27cedb Revises: d1e2f3a4b5c6 Create Date: 2026-01-02 10:54:27.953651 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'bb6b6f27cedb' down_revision: Union[str, Seq...
maraxen/praxis
.agent/backups/alembic_20260121/versions/bb6b6f27cedb_add_maintenance_and_location_columns.py
.py
198b8e06aa306db5
7.35
4
"""add data_views_json to function_protocol_definitions. Revision ID: c9d5e6f7a8b3 Revises: b8c4d5e6f7a2 Create Date: 2026-01-02 """ from collections.abc import Sequence import sqlalchemy as sa from sqlalchemy.dialects import postgresql from alembic import op # revision identifiers, used by Alembic. revision: str ...
maraxen/praxis
.agent/backups/alembic_20260121/versions/c9d5e6f7a8b3_add_data_views_json_to_protocol_defs.py
.py
a7b883a1239202fa
7.35
4
"""add_dynamic_filter_columns_to_resource_definitions. Revision ID: cd193888759e Revises: 577d92edf9a5 Create Date: 2025-12-21 19:33:48.579424 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "cd193888759e" down_revisio...
maraxen/praxis
.agent/backups/alembic_20260121/versions/cd193888759e_add_dynamic_filter_columns_to_resource_.py
.py
1da55846045819d1
7.35
4
"""add computation_graph_json, source_hash, graph_cached_at to function_protocol_definitions. Revision ID: e2f3a4b5c6d7 Revises: bb6b6f27cedb Create Date: 2026-01-03 """ from collections.abc import Sequence import sqlalchemy as sa from sqlalchemy.dialects import postgresql from alembic import op # revision identif...
maraxen/praxis
.agent/backups/alembic_20260121/versions/e2f3a4b5c6d7_add_computation_graph_to_protocol_defs.py
.py
e7ac96b9626945ca
7.35
4
"""add bytecode cache columns to function_protocol_definitions. Revision ID: g4b5c6d7e8f9 Revises: f3a4b5c6d7e8 Create Date: 2026-01-05 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "g4b5c6d7e8f9" down_revision: str ...
maraxen/praxis
.agent/backups/alembic_20260121/versions/g4b5c6d7e8f9_add_bytecode_cache_to_protocol_defs.py
.py
8cd69dd79041b91a
7.35
4
"""add required_plr_category to protocol_asset_requirements. Revision ID: h5c6d7e8f9a0 Revises: g4b5c6d7e8f9 Create Date: 2026-01-10 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "h5c6d7e8f9a0" down_revision: str | N...
maraxen/praxis
.agent/backups/alembic_20260121/versions/h5c6d7e8f9a0_add_required_plr_category_to_assets.py
.py
78042a8b671dd9d0
7.35
4
"""add is_reusable to resource_definitions. Revision ID: i6d7e8f9g0h1 Revises: 3a1fe0851e06 Create Date: 2026-01-16 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "i6d7e8f9g0h1" down_revision: str | None = "3a1fe0851e...
maraxen/praxis
.agent/backups/alembic_20260121/versions/i6d7e8f9g0h1_add_is_reusable_to_resource_definitions.py
.py
7eac72b1149da04a
7.35
4
#!/usr/bin/env python3 """Submit pending Jules dispatches from the agent database.""" import sqlite3 import subprocess import tempfile import time import os DB_PATH = "/Users/mar/Projects/praxis/.agent/agent.db" def get_pending_dispatches(): """Get all pending Jules dispatches.""" conn = sqlite3.connect(DB_PA...
maraxen/praxis
.agent/scripts/submit_jules.py
.py
61e05551960b1cad
7.35
4
#!/usr/bin/env python3 """ Architecture Diagram Generator Automated tool for senior architect tasks """ import os import sys import json import argparse from pathlib import Path from typing import Dict, List, Optional class ArchitectureDiagramGenerator: """Main class for architecture diagram generator functionali...
maraxen/praxis
.agent/skills/senior-architect/scripts/architecture_diagram_generator.py
.py
16d48c6543db51c6
7.35
4
#!/usr/bin/env python3 """ Dependency Analyzer Automated tool for senior architect tasks """ import os import sys import json import argparse from pathlib import Path from typing import Dict, List, Optional class DependencyAnalyzer: """Main class for dependency analyzer functionality""" def __init__(self...
maraxen/praxis
.agent/skills/senior-architect/scripts/dependency_analyzer.py
.py
7ca90d81bccb129c
7.35
4
#!/usr/bin/env python3 """ Project Architect Automated tool for senior architect tasks """ import os import sys import json import argparse from pathlib import Path from typing import Dict, List, Optional class ProjectArchitect: """Main class for project architect functionality""" def __init__(self, targ...
maraxen/praxis
.agent/skills/senior-architect/scripts/project_architect.py
.py
888c16bf91e5b419
7.35
4
#!/usr/bin/env python3 """ Code Quality Analyzer Automated tool for senior fullstack tasks """ import os import sys import json import argparse from pathlib import Path from typing import Dict, List, Optional class CodeQualityAnalyzer: """Main class for code quality analyzer functionality""" def __init__...
maraxen/praxis
.agent/skills/senior-fullstack/scripts/code_quality_analyzer.py
.py
936eef2d89bebbd6
7.35
4
#!/usr/bin/env python3 """ Fullstack Scaffolder Automated tool for senior fullstack tasks """ import os import sys import json import argparse from pathlib import Path from typing import Dict, List, Optional class FullstackScaffolder: """Main class for fullstack scaffolder functionality""" def __init__(s...
maraxen/praxis
.agent/skills/senior-fullstack/scripts/fullstack_scaffolder.py
.py
4312f549f0277246
7.35
4
#!/usr/bin/env python3 """ Project Scaffolder Automated tool for senior fullstack tasks """ import os import sys import json import argparse from pathlib import Path from typing import Dict, List, Optional class ProjectScaffolder: """Main class for project scaffolder functionality""" def __init__(self, t...
maraxen/praxis
.agent/skills/senior-fullstack/scripts/project_scaffolder.py
.py
9844377e81cd5953
7.35
4
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ UI/UX Pro Max Core - BM25 search engine for UI/UX style guides """ import csv import re from pathlib import Path from math import log from collections import defaultdict # ============ CONFIGURATION ============ DATA_DIR = Path(__file__).parent.parent / "data" MAX_RE...
maraxen/praxis
.agent/skills/ui-ux-pro-max/scripts/core.py
.py
8949bb622be5ea28
7.35
4
#!/usr/bin/env python3 """ Start one or more servers, wait for them to be ready, run a command, then clean up. Usage: # Single server python scripts/with_server.py --server "npm run dev" --port 5173 -- python automation.py python scripts/with_server.py --server "npm start" --port 3000 -- python test.py ...
maraxen/praxis
.agent/skills/webapp-testing/scripts/with_server.py
.py
b0dcf4918935b795
7.85
4
import asyncio import os from logging.config import fileConfig from sqlalchemy import pool from sqlalchemy.engine import Connection from sqlalchemy.ext.asyncio import async_engine_from_config from sqlmodel import SQLModel from alembic import context from praxis.backend.utils.db import Base as PraxisBase # --- MODIFIC...
maraxen/praxis
alembic/env.py
.py
24c715d16a2838b3
7.35
4
"""N5-B categorization: Matches / Conflicts / Omissions for clarification cards (W4, FR-7). The derivation reads ONLY the Layer 2/3 output a clarify exit already carries -- a ``GroundingExitPayload``'s candidates, slot and message -- plus nothing else: no kernel reads, no model call, no new grounding lookups. It exist...
maraxen/praxis
coxswain/src/coxswain/categorize.py
.py
209142dfdfe55780
7.35
4
#!/usr/bin/env python import sys sys.path.append("/app") import click import asyncio from typing import get_type_hints import openpyxl from openpyxl.utils import get_column_letter from tqdm import tqdm from sqlmodel import delete, select from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.asyncio import A...
colorado-cancer-center/ecco
backend/app/commands/import_cancer_disparities.py
.py
d8ee1ea5efb01b14
7.3
3