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 |
|---|---|---|---|---|---|---|
# In tests/conftest.py
import gc as garbage_collection
import shutil
import tempfile
from os import listdir
from os.path import dirname, isfile, join, realpath
import netCDF4 as nc
import pytest
import xarray as xr
@pytest.fixture(scope='class')
def data_dir():
"""Gets the directory containing data files used fo... | podaac/l2ss-py | tests/test_subset/conftest.py | .py | f2a6b953078a6016 | 8.1 | 15 |
import urllib.parse
from os import listdir
from os.path import isfile, join
import numpy as np
import pytest
import xarray as xr
from podaac.subsetter import subset
def compare_java(test_file, cut, data_dir, subset_output_dir, request):
"""
Run the L2 subsetter and compare the result to the equivelant
l... | podaac/l2ss-py | tests/test_subset/test_compare_java.py | .py | 041fb97e36258454 | 8.1 | 15 |
import urllib.parse
from os import listdir
from os.path import isfile, join
import numpy as np
import pytest
import xarray as xr
from podaac.subsetter import subset
def compare_python(test_file, cut, data_dir, subset_output_dir, request):
"""
Run the L2 subsetter and compare the result to the equivelant
... | podaac/l2ss-py | tests/test_subset/test_compare_python.py | .py | 9798ccbe0ae3886b | 8.1 | 15 |
from pathlib import Path
from typing import NamedTuple
import numpy as np
import pytest
import xarray as xr
from podaac.subsetter import subset
from podaac.subsetter.utils.variables_utils import get_vars_with_paths
class VariableTestCase(NamedTuple):
input: str
want_var: set[str]
want_coord: set[str]
_... | podaac/l2ss-py | tests/test_subset/test_specified_variables.py | .py | c2cbf18c1d564d62 | 7.1 | 15 |
import os
import shutil
from os.path import join
from pathlib import Path
import numpy as np
import pytest
from conftest import data_files
from harmony_service_lib.exceptions import NoDataException
from podaac.subsetter import subset
@pytest.mark.parametrize("test_file", data_files())
def test_subset_empty_bbox(tes... | podaac/l2ss-py | tests/test_subset/test_subset_empty_bbox.py | .py | 9f31c71e542ad383 | 7.1 | 15 |
from os.path import join
import netCDF4 as nc
import numpy as np
import pytest
import xarray as xr
from conftest import data_files
from podaac.subsetter import datatree_subset, subset
@pytest.mark.parametrize("test_file", data_files())
def test_subset_variables(test_file, data_dir, subset_output_dir, request):
... | podaac/l2ss-py | tests/test_subset/test_subset_variables.py | .py | 9914946c7b9b996f | 7.1 | 15 |
"""Benchmark configuration for running pytest-imports against Django.
The Django source tree is expected at `benchmark/django/` (gitignored,
sibling to this file). The nox `benchmark` session bootstraps it at the
pinned commit.
"""
from __future__ import annotations
import subprocess
import time
from pathlib import ... | nwilbert/pytest-imports | benchmark/conftest.py | .py | 135fc8b5e452db2d | 8.15 | 19 |
import webbrowser
from pathlib import Path
import nox
src_path = 'src'
code_paths = [src_path, 'test', 'noxfile.py']
nox.options.default_venv_backend = 'uv'
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = [
'format',
'lint',
'mypy',
'test',
'coverage',
'audit',
]
_SYNC_... | nwilbert/pytest-imports | noxfile.py | .py | af2d9a790e67a327 | 7.65 | 19 |
from __future__ import annotations
from collections.abc import Iterable, Iterator, Sequence
from dataclasses import dataclass
from pathlib import Path, PurePath
class RootNode:
"""Represents the root of a tree of module nodes."""
def __init__(self) -> None:
self._children: dict[str, ModuleNode] = {}... | nwilbert/pytest-imports | src/pytest_imports/model.py | .py | 05919c53b4b223e1 | 8.15 | 19 |
from __future__ import annotations
import logging
from collections.abc import Sequence
from pathlib import Path
import pytest
from .model import RootNode
from .parser import build_import_model
from .query import Predicate, Scope, evaluate_rules
log = logging.getLogger(__name__)
INI_NAME = 'imports_project_paths'
P... | nwilbert/pytest-imports | src/pytest_imports/plugin.py | .py | f282affcf3dc8525 | 8.15 | 19 |
from __future__ import annotations
from collections.abc import Iterator
from dataclasses import dataclass
from typing import Literal
from .model import DotPath, ImportInModule, ModuleNode, RootNode
@dataclass(frozen=True)
class Descendants:
"""Target matching the descendants of `path`, excluding `path` itself.
... | nwilbert/pytest-imports | src/pytest_imports/query.py | .py | c2617223488c13de | 8.15 | 19 |
from inspect import cleandoc
def test_project_path_from_toml_config(pytester):
"""Test that config values are read from pyproject.toml"""
pytester.makepyprojecttoml("""
[tool.pytest.ini_options]
imports_project_paths = [
"foobar",
"/foo/bar"
]
""")
pytes... | nwilbert/pytest-imports | test/integration/plugin/test_projectpath.py | .py | cb5f5a7929e5afe2 | 7.15 | 19 |
#!/usr/bin/env -S uv run --script --locked
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "packaging==26.3",
# ]
# ///
import os
import re
import sys
from pathlib import Path
from packaging.version import Version
# taken verbatim from hatch/hatchling so the logic should match
DEFAULT_PATTERN = r'(... | samuelcolvin/check-python-version | check-python-version.py | .py | 564f06b8e430e28d | 7.5 | 9 |
"""Active storage module."""
import fsspec
import numpy as np
import pyfive
from numcodecs.compat import ensure_ndarray
def reduce_chunk(rfile,
offset,
size,
compression,
filters,
missing,
dtype,
sha... | NCAS-CMS/PyActiveStorage | activestorage/storage.py | .py | e038bab50f68cf6b | 7.42 | 6 |
"""Generates sidebar/toctree.
Generates the common sidebar/toctree for the sphinx/ReadTheDocs
documentation of the PyActiveStorage and its subprojects.
"""
import os
def _write_if_changed(fname, contents):
"""Write/update file only if changed."""
try:
with open(fname, "r") as stream:
old... | NCAS-CMS/PyActiveStorage | doc/gensidebar.py | .py | 83ab9729f80d1bb9 | 7.42 | 6 |
"""
Parse and display test memory.
Uses pytest-monitor plugin from https://github.com/CFMTech/pytest-monitor
Lots of other metrics can be read from the file via sqlite parsing.,
currently just MEM_USAGE (RES memory, in MB).
"""
import sqlite3
import sys
from operator import itemgetter
def _get_big_mem_tests(cur):
... | NCAS-CMS/PyActiveStorage | tests/s3_exploratory/parse_pymon.py | .py | 595b7a585f4f94e9 | 7.92 | 6 |
import itertools
import netCDF4
import numpy as np
import pytest
from activestorage.active import Active
def axis_combinations(ndim):
"""Create axes permutations"""
return [None] + [
axes for n in range(1, ndim + 1)
for axes in itertools.permutations(range(ndim), n)
]
rfile = "tests/te... | NCAS-CMS/PyActiveStorage | tests/unit/test_active_axis.py | .py | f75dff794df60cf9 | 7.92 | 6 |
import os
import pathlib
from tempfile import NamedTemporaryFile
import h5netcdf
import numpy as np
import pyfive
import pytest
import s3fs
from activestorage.active import Active, load_from_s3
# needed by the spoofed s3 filesystem
port = 5555
endpoint_uri = "http://127.0.0.1:%s/" % port
def test_s3fs_s3(s3fs_s3):... | NCAS-CMS/PyActiveStorage | tests/unit/test_mock_s3.py | .py | ddf636bb34261f4c | 7.92 | 6 |
"""Build sentence-level CSV for De historia van den souen wysen meisteren (ca.1478; Middle Low German / Middle Dutch incunable Seven Sages of Rome).
DBNL provides a diplomatic TEI Lite transcription. DBNL ID `_his022hist01`.
Source: https://www.dbnl.org/titels/titel.php?id=_his022hist01
Text-specific fix: ``split_on... | alexanderboxer/voynich-attack | corpora/dutch/DBNL/1478_souen_wysen/build.py | .py | d9a633c9bc6d8f35 | 7.48 | 8 |
"""Build sentence-level CSV for De Vorsterman Bijbel (1528/1531; Antwerp Dutch Bible printed by Willem Vorsterman).
DBNL provides a diplomatic TEI Lite transcription. DBNL ID `_vor003vors01`.
Source: https://www.dbnl.org/titels/titel.php?id=_vor003vors01
Text-specific fixes (post-processing — nothing in the shared p... | alexanderboxer/voynich-attack | corpora/dutch/DBNL/1531_vorsterman_bijbel/build.py | .py | 2549ef06001528f3 | 7.48 | 8 |
"""Build sentence-level CSV for Caxton's Parvus Catho (1476).
Caxton's printed edition of the Distichs of Cato. TCP ID A18231 (Phase I,
CC0). Source: https://github.com/textcreationpartnership/A18231
Bilingual structure: each <lg> wraps a <head><l>...</l></head> Latin
distich followed by <l> children of Caxton's Engl... | alexanderboxer/voynich-attack | corpora/english/EEBO/1476_caxton_cato/build.py | .py | 839e4244d2cc6337 | 7.48 | 8 |
"""Build sentence-level CSV for Caxton's Parvus Catho — Latin/English (1477).
Caxton's print of the Distichs of Cato. TCP ID A18230 (Phase I, CC0).
Like the 1476 edition (A18231 / 1476_caxton_cato), this is bilingual —
each Latin distich is followed by Caxton's English verse translation —
but the TEI encoding differs:... | alexanderboxer/voynich-attack | corpora/english/EEBO/1477_caxton_cato/build.py | .py | dbe8b541b4644c0c | 7.48 | 8 |
"""Build sentence-level CSV for Dictes or Sayings of the Philosophers (1477).
Caxton's print of Earl Rivers' English translation of "Dits Moraulx des
Philosophes" — collected sayings of ancient philosophers. TCP ID A69207
(Phase I, CC0). Source: https://github.com/textcreationpartnership/A69207
"""
import re
from pat... | alexanderboxer/voynich-attack | corpora/english/EEBO/1477_dictes/build.py | .py | bb6af71ddb6a08ec | 7.48 | 8 |
"""Build the sentence-level CSV for Gottfried 1497 (DTA id nn_gottfried_1497)."""
from pathlib import Path
from lxml import etree
from voynpy.corpus_build.dta import download_xml
from voynpy.corpus_build.normalize import rich_normalize, simple_normalize
from voynpy.corpus_build.schema import Row, write_csv
from voyn... | alexanderboxer/voynich-attack | corpora/german/DTA/1497_nn_gottfried/build.py | .py | e086effe0a0ea615 | 7.48 | 8 |
"""Build the sentence-level CSV for Morgener 1497 (DTA id oa_morgener_1497)."""
from pathlib import Path
from voynpy.corpus_build.dta import download_xml
from voynpy.corpus_build.normalize import rich_normalize, simple_normalize
from voynpy.corpus_build.schema import Row, write_csv
from voynpy.corpus_build.tei_p5 imp... | alexanderboxer/voynich-attack | corpora/german/DTA/1497_oa_morgener/build.py | .py | 342fc9b02a2ebdf0 | 7.48 | 8 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.avl_cortesfpha_dec import TabelaCortesFpha
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
class AvlCortesFpha(ArquivoCSV):
"""
Arquivo com os cortes da fun... | rjmalves/idecomp | idecomp/decomp/avl_cortesfpha_dec.py | .py | faeb81785a9f7deb | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.avl_turb_max import TabelaAvlTurbMax
class AvlTurbMax(ArquivoCSV):
"""
Arquivo com avaliação do turbinamento máximo das usinas hidrelétricas do DECOMP.
"""
BLOCKS = [T... | rjmalves/idecomp | idecomp/decomp/avl_turb_max.py | .py | 37bb9ad6da03de45 | 7.52 | 10 |
from typing import Any, TypeVar
from cfinterface.files.sectionfile import SectionFile
from idecomp.decomp.modelos.caso import NomeCaso
class Caso(SectionFile):
"""
Armazena os dados de entrada do DECOMP referentes ao nome do arquivo
que define os arquivos do caso.
Esta classe lida com i... | rjmalves/idecomp | idecomp/decomp/caso.py | .py | dd88b1a6da853d11 | 7.52 | 10 |
from typing import Any, TypeVar
import pandas as pd # type: ignore[import-untyped]
from cfinterface.components.block import Block
from cfinterface.files.blockfile import BlockFile
from idecomp.decomp.modelos.custos import BlocoRelatorioCustos
class Custos(BlockFile):
"""
Armazena os dados de saída do DECOM... | rjmalves/idecomp | idecomp/decomp/custos.py | .py | b305bd71a15957a1 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_avl_evap import TabelaAvlEvap
class DecAvlEvap(ArquivoCSV):
"""
Arquivo com a avaliação da evaporação li... | rjmalves/idecomp | idecomp/decomp/dec_avl_evap.py | .py | 5404a77a02877501 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_cortes_evap import TabelaCortesEvap
class DecCortesEvap(ArquivoCSV):
"""
Arquivo com os cortes da evapor... | rjmalves/idecomp | idecomp/decomp/dec_cortes_evap.py | .py | eb12eda15abd797b | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_desvfpha import TabelaDesvFpha
class DecDesvFpha(ArquivoCSV):
"""
Arquivo com os desvios da função de pr... | rjmalves/idecomp | idecomp/decomp/dec_desvfpha.py | .py | 424b77f71732bcc0 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_eco_cotajus import TabelaEcoCotajus
class DecEcoCotajus(ArquivoCSV):
"""
Arquivo com o eco dos polinômio... | rjmalves/idecomp | idecomp/decomp/dec_eco_cotajus.py | .py | 6948705e9b2e6613 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_eco_discr import TabelaEcoDiscr
class DecEcoDiscr(ArquivoCSV):
"""
Arquivo com a discretização temporal ... | rjmalves/idecomp | idecomp/decomp/dec_eco_discr.py | .py | e7c7ba436535b62e | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_eco_evap import TabelaEcoEvap
class DecEcoEvap(ArquivoCSV):
"""
Arquivo com o eco dos dados da considera... | rjmalves/idecomp | idecomp/decomp/dec_eco_evap.py | .py | 2cd4845935cc5b58 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_eco_qlat import TabelaEcoQlat
class DecEcoQlat(ArquivoCSV):
"""
Arquivo com o eco dos dados para cálculo... | rjmalves/idecomp | idecomp/decomp/dec_eco_qlat.py | .py | 9b48b27b97d05d30 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_estatevap import TabelaEstatEvap
class DecEstatEvap(ArquivoCSV):
"""
Arquivo com as estatísticas de desv... | rjmalves/idecomp | idecomp/decomp/dec_estatevap.py | .py | 01a8f7f8a0c3eee6 | 7.52 | 10 |
from typing import TypeVar
import pandas as pd # type: ignore
from cfinterface.files.blockfile import BlockFile
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_estatfpha import (
BlocoDesvios,
)
class DecEstatFpha(BlockFile):
"""
Arquivo com os dados ... | rjmalves/idecomp | idecomp/decomp/dec_estatfpha.py | .py | 10262572aedce578 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_fcf_cortes import TabelaFcfCortes
class DecFcfCortes(ArquivoCSV):
"""
Arquivo com os cortes da FCF gerad... | rjmalves/idecomp | idecomp/decomp/dec_fcf_cortes.py | .py | 2d8ea16243f90760 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_evap import (
TabelaOperEvap,
TabelaOperEvapv31,
)
class DecOperEvap(ArquivoCSV):
"""
Arqui... | rjmalves/idecomp | idecomp/decomp/dec_oper_evap.py | .py | ddc6fcfab79ce5c6 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_gnl import TabelaOperGnl, TabelaOperGnlv31
class DecOperGnl(ArquivoCSV):
"""
Arquivo com a operação... | rjmalves/idecomp | idecomp/decomp/dec_oper_gnl.py | .py | 25b4576c7674195a | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_interc import (
TabelaOperInterc,
TabelaOperIntercv31,
)
class DecOperInterc(ArquivoCSV):
"""
... | rjmalves/idecomp | idecomp/decomp/dec_oper_interc.py | .py | 6ef7f3632cf3d146 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_ree import TabelaOperRee, TabelaOperReev31
class DecOperRee(ArquivoCSV):
"""
Arquivo com a operação... | rjmalves/idecomp | idecomp/decomp/dec_oper_ree.py | .py | 92c79add813f3f83 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_rhesoft import (
TabelaOperRheSoft,
TabelaOperRheSoftv31,
)
class DecOperRheSoft(ArquivoCSV):
"... | rjmalves/idecomp | idecomp/decomp/dec_oper_rhesoft.py | .py | 2a84673bf3626cf3 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_sist import (
TabelaOperSist,
TabelaOperSistv31,
)
class DecOperSist(ArquivoCSV):
"""
Arqui... | rjmalves/idecomp | idecomp/decomp/dec_oper_sist.py | .py | c090ee05de3f2a8b | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_usie import (
TabelaOperUsie,
TabelaOperUsiev31,
)
class DecOperUsie(ArquivoCSV):
"""
Arqui... | rjmalves/idecomp | idecomp/decomp/dec_oper_usie.py | .py | b5f31aa4205ec026 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_usih import (
TabelaOperUsih,
TabelaOperUsihv31,
)
class DecOperUsih(ArquivoCSV):
"""
Arqui... | rjmalves/idecomp | idecomp/decomp/dec_oper_usih.py | .py | ab1f313f124bb63e | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.dec_oper_usit import (
TabelaOperUsit,
TabelaOperUsitv31,
)
class DecOperUsit(ArquivoCSV):
"""
Arqui... | rjmalves/idecomp | idecomp/decomp/dec_oper_usit.py | .py | 9515df1cb3ac87ae | 7.52 | 10 |
from typing import Any, TypeVar
import pandas as pd # type: ignore[import-untyped]
from cfinterface.files.blockfile import BlockFile
from idecomp.decomp.modelos.decomptim import BlocoTemposEtapas
class Decomptim(BlockFile):
"""
Armazena os dados de saída do DECOMP referentes ao
tempo de execução das et... | rjmalves/idecomp | idecomp/decomp/decomptim.py | .py | da6ddf568fa74e66 | 7.52 | 10 |
import pandas as pd # type: ignore
from idecomp.decomp.modelos.arquivoscsv.arquivocsv import ArquivoCSV
from idecomp.decomp.modelos.blocos.versaomodelo import VersaoModelo
from idecomp.decomp.modelos.eco_fpha import TabelaEcoFpha
class EcoFpha(ArquivoCSV):
"""
Arquivo com o eco dos dados para modelagem da
... | rjmalves/idecomp | idecomp/decomp/eco_fpha.py | .py | bada6c539320f8b7 | 7.52 | 10 |
from typing import TypeVar
import pandas as pd # type: ignore
from cfinterface.files.blockfile import BlockFile
from idecomp.decomp.modelos.fcfnw import BlocoCortesFCF
class Fcfnw(BlockFile):
"""
Armazena os dados de saída do DECOMP referentes ao
acoplamento realizado com a FCF do NEWAVE.
Esta cla... | rjmalves/idecomp | idecomp/decomp/fcfnw.py | .py | 7b83a5b1d42d2cc8 | 7.52 | 10 |
from pathlib import Path
from typing import IO, Any, TypeVar
from warnings import warn
import pandas as pd # type: ignore[import-untyped] # no pandas-stubs package
from cfinterface.files.registerfile import RegisterFile
from cfinterface.storage import StorageType
from idecomp.config import MESES_ABREV
from idecomp.... | rjmalves/idecomp | idecomp/decomp/hidr.py | .py | 975d1c6ac640b1df | 7.52 | 10 |
from typing import Any, TypeVar
import pandas as pd # type: ignore[import-untyped]
from cfinterface.files.blockfile import BlockFile
from idecomp.decomp.modelos.inviabunic import (
BlocoInviabilidadesIteracoes,
BlocoInviabilidadesSimFinal,
)
class InviabUnic(BlockFile):
"""
Armazena os dados de saí... | rjmalves/idecomp | idecomp/decomp/inviabunic.py | .py | cd45d603c1620f66 | 7.52 | 10 |
from typing import IO, Any, TypeVar
import numpy as np
import pandas as pd # type: ignore[import-untyped]
from cfinterface.files.sectionfile import SectionFile
from idecomp.decomp.modelos.mlt import SecaoMlt
class Mlt(SectionFile):
"""
Armazena os dados de entrada do DECOMP referentes às médias
mensais... | rjmalves/idecomp | idecomp/decomp/mlt.py | .py | b157efdf218c6ff2 | 7.52 | 10 |
from typing import IO, Any
import pandas as pd # type: ignore[import-untyped]
from cfinterface.components.line import Line
from cfinterface.components.literalfield import LiteralField
from cfinterface.components.section import Section
class BlocoNomesArquivos(Section):
"""
Bloco de informações do ... | rjmalves/idecomp | idecomp/decomp/modelos/arquivos.py | .py | bf829defddcd49b8 | 7.52 | 10 |
from typing import TypeVar
import pandas as pd # type: ignore
from cfinterface.components.block import Block
from cfinterface.files.blockfile import BlockFile
from idecomp.decomp.modelos.blocos.tabelacsv import TabelaCSV, TabelaCSVLibs
from idecomp.decomp.modelos.blocos.versaomodelo import (
VersaoModelo,
Ve... | rjmalves/idecomp | idecomp/decomp/modelos/arquivoscsv/arquivocsv.py | .py | 5d43043923418d55 | 7.52 | 10 |
# -*- coding: utf-8 -*-
"""
Scirpt that matches units identified in mixed alignment to corresponding
units in min/max alignment to identify merge candidates.
@author: mmagnuski
"""
# SETTINGS
# --------
# the directory with sorting results - that is after manual curation and
# export using updateSORTINGresults_mm ma... | labianca/pylabianca | pylabianca/scripts/spike_postproc_correct_mixed_alignment.py | .py | e478aabd29216a5e | 7.42 | 6 |
# -*- coding: utf-8 -*-
"""
Check region changes after localization.
Created on Tue Jun 20 20:01:40 2023
@author: Asus
"""
import os
import os.path as op
import numpy as np
import pandas as pd
data_dir = r'C:\Users\Asus\OneDrive - Nencki PAN\RESEARCH\anat\derivatives\labels'
files = [f for f in os.listdir(data_di... | labianca/pylabianca | pylabianca/scripts/test_region_changes.py | .py | 6eeccf969f2a030a | 7.92 | 6 |
import numpy as np
import pandas as pd
from scipy import stats
import xarray as xr
import pylabianca as pln
from pylabianca.analysis import (
_symmetric_window_samples, _gauss_kernel_samples)
from pylabianca.testing import random_spikes, random_xarray
from pylabianca.selectivity import (
compute_selectivity_co... | labianca/pylabianca | pylabianca/test/test_selectivity.py | .py | bd16966c3a7e4c63 | 7.92 | 6 |
import numpy as np
import xarray as xr
import pytest
from functools import partial
from scipy.ndimage import gaussian_filter1d
from scipy.stats import ttest_rel, ttest_ind, f_oneway, kruskal
import pylabianca as pln
def test_permutation_test():
# current borsar does not have ttest_ind_no_p with equal_var=False
... | labianca/pylabianca | pylabianca/test/test_stats.py | .py | fd4d90555c88de86 | 7.92 | 6 |
from warnings import warn
import numpy as np
import pandas as pd
def _deal_with_picks(spk, picks):
'''Deal with various formats in which ``picks`` can be passed.
Parameters
----------
spk : pylabianca.Spikes | pylabianca.SpikeEpochs
Spikes or SpikeEpochs object.
picks : int | str | list-... | labianca/pylabianca | pylabianca/utils/base.py | .py | 528100491e34a7b6 | 7.42 | 6 |
import numpy as np
# TODO - if other sorters are used, alignment point (sample_idx) for the
# spike waveforms should be saved somewhere in spk and used here.
def infer_waveform_polarity(spk, cell_idx, threshold=1.75, baseline_range=50,
rich_output=False):
"""Decide whether wavef... | labianca/pylabianca | pylabianca/utils/waveform.py | .py | 86fe6128bcbccc93 | 7.42 | 6 |
"""
Audio class for loading and playing sounds
"""
import logging
import pygame as pg
class Audio:
"""
Audio class for loading and playing sounds
"""
def __init__(self):
self.sounds = {}
def load_sound(self, name, path):
"""
Load a sound file
name: name of the soun... | ArtBIT/pygame-template | src/audio.py | .py | 95b09c56597aec4c | 7.59 | 14 |
"""
This is the main game file. It is responsible for the game loop and
changing states.
"""
import os
import sys
import logging
import pygame as pg
from input import Input
from audio import Audio
from settings import *
from components import *
import states
class Game:
"""
Main game class
"""
def __i... | ArtBIT/pygame-template | src/game.py | .py | 29cd486fe281ef30 | 7.59 | 14 |
"""
This module handles input from the user.
"""
import logging
import pygame as pg
import pygame.constants as pgc
from pygame.locals import *
class Input:
"""
Input class for handling input from the user
"""
def __init__(self):
self.keys_down = set()
self.keys_pressed = set()
... | ArtBIT/pygame-template | src/input.py | .py | 2a88a563b8a9e448 | 7.59 | 14 |
'''
Copyright 2022 Airbus SAS
Modifications on 2024/06/07-2024/06/13 Copyright 2024 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | os-climate/sostrades-webapi | migrations/env.py | .py | 627b5bc9e1aad11a | 7.45 | 7 |
"""
col_default_app_group
Revision ID: 0f797979d08f
Revises: 89b66a62d3a7
Create Date: 2022-02-14 16:53:50.917357
"""
import sqlalchemy as sa
from alembic import op
from sos_trades_api.models.database_models import Group
from sos_trades_api.server.base_server import db
# revision identifiers, used by ... | os-climate/sostrades-webapi | migrations/versions/0f797979d08f_col_default_app_group.py | .py | f0d6d255d2a4c524 | 7.45 | 7 |
"""
add pod flavors
Revision ID: 18d8890a5e5f
Revises: dda4d408a5e0
Create Date: 2024-03-22 10:20:46.055342
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "18d8890a5e5f"
down_revision = "dda4d408a5e0"
branch_labels = None
depends_on = None
def upgrade():
... | os-climate/sostrades-webapi | migrations/versions/18d8890a5e5f_add_pod_flavors.py | .py | c020f22b1621e80b | 7.45 | 7 |
"""
add oauth state management
Revision ID: 23659f27ce8a
Revises: 26c265508f79
Create Date: 2022-05-17 10:29:40.233373
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "23659f27ce8a"
down_revision = "26c265508f79"
branch_labels = None
depends_on = ... | os-climate/sostrades-webapi | migrations/versions/23659f27ce8a_add_oauth_state_management.py | .py | 9edc77cc0b0ae154 | 7.45 | 7 |
"""
User default group
Revision ID: 26c265508f79
Revises: 9dce152cd92c
Create Date: 2022-04-05 15:20:23.117422
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "26c265508f79"
down_revision = "9dce152cd92c"
branch_labels = None
depends_on = None
... | os-climate/sostrades-webapi | migrations/versions/26c265508f79_user_default_group.py | .py | 78c6a2d709bc3336 | 7.45 | 7 |
"""Increase size of repository
Revision ID: 2db3dd3d7e5c
Revises: 6742a7abbc12
Create Date: 2024-08-08 18:43:41.524297
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '2db3dd3d7e5c'
down_revision = '6742a7abbc12'
branch_labe... | os-climate/sostrades-webapi | migrations/versions/2db3dd3d7e5c_increase_size_of_repository.py | .py | 54864aeca0b7f6f4 | 7.45 | 7 |
"""add error management on study object
Revision ID: 35ba4ee9fc53
Revises: b4c65e383551
Create Date: 2021-12-01 15:35:13.637919
"""
import sqlalchemy as sa
from alembic import op
from sos_trades_api.server.base_server import db
# revision identifiers, used by Alembic.
revision = "35ba4ee9fc53"
down_re... | os-climate/sostrades-webapi | migrations/versions/35ba4ee9fc53_add_error_management_on_study_object.py | .py | c330a6e88820841a | 7.45 | 7 |
"""add stand alone status
Revision ID: 4800f7e11ae2
Revises: 6d471f14fb35
Create Date: 2025-05-22 11:07:27.645919
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '4800f7e11ae2'
down_revision = '6d471f14fb35'
branch_labels = None
depends_on = None
def upgrade()... | os-climate/sostrades-webapi | migrations/versions/4800f7e11ae2_add_stand_alone_status.py | .py | 09fe67db309d3b66 | 7.45 | 7 |
"""
Add last opened study
Revision ID: 4d179998acd8
Revises: fb0a1fde7fe0
Create Date: 2022-12-07 14:34:47.294663
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "4d179998acd8"
down_revision = "fb0a1fde7fe0"
branch_labels = None
depends_on = None
... | os-climate/sostrades-webapi | migrations/versions/4d179998acd8_add_last_opened_study.py | .py | acf3ff66c50679bf | 7.45 | 7 |
"""
add_no_execution_profile
Revision ID: 59ef3f9fbb52
Revises: 6fde15c1f0d5
Create Date: 2023-12-01 16:43:23.266590
"""
from sos_trades_api.models.database_models import UserProfile
from sos_trades_api.server.base_server import db
# revision identifiers, used by Alembic.
revision = "59ef3f9fbb52"
down_revision = "6... | os-climate/sostrades-webapi | migrations/versions/59ef3f9fbb52_add_no_execution_profile.py | .py | 8eee8a1d7c14e358 | 7.45 | 7 |
"""
add studycase creation status
Revision ID: 5acd0bb7bad9
Revises: 59ef3f9fbb52
Create Date: 2024-03-04 09:30:37.433245
"""
import sqlalchemy as sa
from alembic import op
from sos_trades_api.models.database_models import StudyCase
from sos_trades_api.server.base_server import db
# revision identifiers, used by Al... | os-climate/sostrades-webapi | migrations/versions/5acd0bb7bad9_add_studycase_creation_status.py | .py | eabfa08022fd4c04 | 7.45 | 7 |
"""update pod allocation
Revision ID: 5b6303f4ab8e
Revises: 5acd0bb7bad9
Create Date: 2024-03-15 16:53:44.531536
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "5b6303f4ab8e"
down_revision = "5acd0bb7bad9"
branch_labels = N... | os-climate/sostrades-webapi | migrations/versions/5b6303f4ab8e_update_pod_allocation.py | .py | 36771dfe62397c38 | 7.45 | 7 |
"""
Add information about deleting a column from a dataframe
Revision ID: 5e995cf0ba49
Revises: 4d179998acd8
Create Date: 2023-08-22 09:38:43.798515
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "5e995cf0ba49"
down_revisio... | os-climate/sostrades-webapi | migrations/versions/5e995cf0ba49_add_information_about_deleting_a_column_.py | .py | 4397f48bb9081e62 | 7.45 | 7 |
"""update user preference
Revision ID: 6742a7abbc12
Revises: 7df43d135e7c
Create Date: 2024-07-19 16:01:34.058228
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '6742a7abbc12'
down_revision = '7df43d135e7c'
branch_labels = ... | os-climate/sostrades-webapi | migrations/versions/6742a7abbc12_update_user_preference.py | .py | 5c50517323469b2f | 7.45 | 7 |
"""update column execution message
Revision ID: 6d471f14fb35
Revises: 9187d11fbebc
Create Date: 2024-10-21 09:01:41.850232
"""
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '6d471f14fb35'
down_revision = '9187d11fbebc'
branch_labels = None
depends_on... | os-climate/sostrades-webapi | migrations/versions/6d471f14fb35_update_column_execution_message.py | .py | e1220e8635341a00 | 7.45 | 7 |
"""add_user_api_key_table
Revision ID: 7d5cb767db48
Revises: 4800f7e11ae2
Create Date: 2025-09-29 16:06:15.200576
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '7d5cb767db48'
down_revision = '4800f7e11ae2'
branch_labels = None
depends_on = None
def upgrade()... | os-climate/sostrades-webapi | migrations/versions/7d5cb767db48_add_user_api_key_table.py | .py | 26272e53f8bc9016 | 7.45 | 7 |
"""
adding dataset information to StudyCaseChange
Revision ID: 7df43d135e7c
Revises: 81ddc6b58939
Create Date: 2024-04-29 11:06:20.428697
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "7df43d135e7c"
down_revision = "81ddc6... | os-climate/sostrades-webapi | migrations/versions/7df43d135e7c_adding_dataset_information_to_.py | .py | eca5c84828c8634b | 7.45 | 7 |
"""
add pod status monitoring
Revision ID: 81ddc6b58939
Revises: 18d8890a5e5f
Create Date: 2024-04-04 09:14:16.478947
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "81ddc6b58939"
down_revision = "18d8890a5e5f"
branch_labels = None
depends_on = None
def upgra... | os-climate/sostrades-webapi | migrations/versions/81ddc6b58939_add_pod_status_monitoring.py | .py | 44892173bce56825 | 7.45 | 7 |
"""
Remove displine and type in studycaseValidationModel
Revision ID: 89b66a62d3a7
Revises: 35ba4ee9fc53
Create Date: 2022-02-02 10:45:32.800916
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "89b66a62d3a7"
do... | os-climate/sostrades-webapi | migrations/versions/89b66a62d3a7_remove_displine_and_type_in_.py | .py | fc9cabf3a3bbf342 | 7.45 | 7 |
"""add dataset data path to StudyCaseChange
Revision ID: 9187d11fbebc
Revises: 2db3dd3d7e5c
Create Date: 2024-09-02 16:43:00.183962
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '9187d11fbebc'
down_revision = '2db3dd3d7e5c... | os-climate/sostrades-webapi | migrations/versions/9187d11fbebc_add_dataset_data_path_to_studycasechange.py | .py | aaf079441112ac98 | 7.45 | 7 |
"""
add link model
Revision ID: 9dce152cd92c
Revises: aede0731db6b
Create Date: 2022-03-03 12:17:18.079065
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "9dce152cd92c"
down_revision = "aede0731db6b"
branch_labels = None
depends_on = None
de... | os-climate/sostrades-webapi | migrations/versions/9dce152cd92c_add_link_model.py | .py | 4803ffcfe1403a69 | 7.45 | 7 |
"""
Add table favorite study
Revision ID: aede0731db6b
Revises: 0f797979d08f
Create Date: 2022-02-28 10:40:41.290528
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "aede0731db6b"
down_revision = "0f797979d08f"
branch_labels = None
depends_on = No... | os-climate/sostrades-webapi | migrations/versions/aede0731db6b_add_table_favorite_study.py | .py | 00fc3ce61651679f | 7.45 | 7 |
"""Default Groups
Revision ID: b4c65e383551
Revises: 039eba317a4e
Create Date: 2021-10-05 17:54:14.072536
"""
from sos_trades_api.models.database_models import Group, GroupAccessUser
from sos_trades_api.server.base_server import db
# revision identifiers, used by Alembic.
revision = "b4c65e383551"
down_r... | os-climate/sostrades-webapi | migrations/versions/b4c65e383551_default_groups.py | .py | 548d9521dd4b4065 | 7.45 | 7 |
"""
Add news table
Revision ID: bcc99700bfe4
Revises: cbf661e68ff3
Create Date: 2022-09-07 10:39:39.317998
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "bcc99700bfe4"
down_revision = "cbf661e68ff3"
branch_labels = None
depends_on = None
de... | os-climate/sostrades-webapi | migrations/versions/bcc99700bfe4_add_news_table.py | .py | d7565ccc7101be19 | 7.45 | 7 |
"""
Add study case allocation table
Revision ID: cbf661e68ff3
Revises: d341b6f43c5b
Create Date: 2022-08-12 10:34:00.497218
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "cbf661e68ff3"
down_revision = "d341b6f43c5b"
branch_labels = None
depends_... | os-climate/sostrades-webapi | migrations/versions/cbf661e68ff3_add_study_case_allocation_table.py | .py | 4f5d45e7f4557371 | 7.45 | 7 |
"""
Add study case logging table
Revision ID: d341b6f43c5b
Revises: ead421cc5deb
Create Date: 2022-07-26 11:07:28.253405
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "d341b6f43c5b"
down_revision = "ead421cc5deb"
branch_labels = None
depends_on ... | os-climate/sostrades-webapi | migrations/versions/d341b6f43c5b_add_study_case_logging_table.py | .py | 3c3c1dacfe246eb8 | 7.45 | 7 |
"""
add flavors in pod allocation
Revision ID: dda4d408a5e0
Revises: 5b6303f4ab8e
Create Date: 2024-03-21 11:08:52.739843
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "dda4d408a5e0"
down_revision = "5b6303f4ab8e"
branch_l... | os-climate/sostrades-webapi | migrations/versions/dda4d408a5e0_add_flavors_in_pod_allocation.py | .py | 08cd0f0e0a3f9b58 | 7.45 | 7 |
"""
Default user profiles
Revision ID: e87facea6cda
Revises: 40ca717b5c0a
Create Date: 2021-10-05 17:52:36.266661
"""
from sos_trades_api.models.database_models import UserProfile
from sos_trades_api.server.base_server import db
# revision identifiers, used by Alembic.
revision = "e87facea6cda"
down_rev... | os-climate/sostrades-webapi | migrations/versions/e87facea6cda_default_user_profiles.py | .py | fef77a6a38c8765c | 7.45 | 7 |
"""
Add device model to manage api-key by group
Revision ID: ead421cc5deb
Revises: 23659f27ce8a
Create Date: 2022-05-18 16:34:06.326494
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "ead421cc5deb"
down_revision = "23659f27ce8a"
branch_labels = No... | os-climate/sostrades-webapi | migrations/versions/ead421cc5deb_add_device_model_to_manage_api_key_by_.py | .py | 7edf8df4d6dfc0fa | 7.45 | 7 |
"""
increase size of reference path
Revision ID: fb0a1fde7fe0
Revises: bcc99700bfe4
Create Date: 2022-09-21 11:28:43.480706
"""
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "fb0a1fde7fe0"
down_revision = "bcc99700bfe4"
branch_labels = ... | os-climate/sostrades-webapi | migrations/versions/fb0a1fde7fe0_increase_size_of_reference_path.py | .py | 6491eac14c71a04e | 7.45 | 7 |
'''
Copyright 2022 Airbus SAS
Modifications on 2023/05/12-2023/11/03 Copyright 2023 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless ... | os-climate/sostrades-webapi | server_scripts/calculation/launch_calculation.py | .py | b4a5e005d4869c13 | 7.45 | 7 |
'''
Copyright 2025 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | os-climate/sostrades-webapi | sos_trades_api/blueprints/ontology/ontology_blueprint.py | .py | 5c8c02f5443f8394 | 7.45 | 7 |
'''
Copyright 2025 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | os-climate/sostrades-webapi | sos_trades_api/blueprints/study_case/read_only_blueprint.py | .py | 45aa279ba573b463 | 7.45 | 7 |
'''
Copyright 2025 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | os-climate/sostrades-webapi | sos_trades_api/blueprints/study_case/study_case_parameter.py | .py | 88c1ee5f351d201c | 7.45 | 7 |
'''
Copyright 2022 Airbus SAS
Modifications on 2024/06/07 Copyright 2024 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless req... | os-climate/sostrades-webapi | sos_trades_api/controllers/error_classes.py | .py | 8e11ecc7d1a55eae | 7.45 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.