Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve query ops API, update deps #477

Merged
merged 11 commits into from
Sep 7, 2023
11 changes: 11 additions & 0 deletions .github/workflows/docs_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ jobs:
# pandoc README.md -f markdown -t rst -s -o docs/source/intro.rst
cd docs && rm -rf source/reference/api/_autosummary && make html
cd .. && coverage run -m pytest -m "not integration_test" && coverage xml && coverage report -m
- name: Upload coverage to Codecov
uses: Wandalen/[email protected]
with:
action: codecov/[email protected]
with: |
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
name: codecov-umbrella
fail_ci_if_error: true
attempt_limit: 5
attempt_delay: 30000
- uses: actions/setup-node@v3
with:
node-version: 18
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
poetry install --without dev,docs,interface
coverage run -m pytest -m integration_test && coverage xml && coverage report -m
- name: Upload coverage to Codecov
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: Wandalen/[email protected]
with:
action: codecov/[email protected]
Expand Down
22 changes: 22 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
codecov:
after_n_builds: 2
require_ci_to_pass: true
comment:
behavior: default
layout: reach,diff,flags,tree,reach
show_carryforward_flags: false
require_changes: true
coverage:
precision: 2
range:
- 55.0
- 100.0
round: down
status:
changes: true
default_rules:
flag_coverage_not_uploaded_behavior: include
patch: true
project: true
github_checks:
annotations: true
2 changes: 1 addition & 1 deletion cyclops/evaluate/metrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def common_input_checks_and_format(
def sigmoid(arr: npt.ArrayLike) -> npt.NDArray[np.float_]:
"""Sigmoid function."""
arr = np.asanyarray(arr)
return 1 / (1 + np.exp(-arr))
return 1 / (1 + np.exp(-arr)) # type: ignore


def check_topk(top_k: int, type_preds: str, type_target: str, n_classes: int) -> None:
Expand Down
24 changes: 15 additions & 9 deletions cyclops/monitor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,23 +373,26 @@ def __init__(
x_ref_preprocessed: bool = False,
preprocess_at_init: bool = True,
update_x_ref: Optional[Dict[str, int]] = None,
preprocess_fn: Optional[Callable[..., Any]] = None,
preprocess_fn: Optional[Callable] = None,
n_permutations: int = 100,
batch_size_permutations: int = 1000000,
var_reg: float = 1e-5,
reg_loss_fn: Callable[..., Any] = (lambda kernel: 0),
reg_loss_fn: Callable = (lambda kernel: 0),
train_size: Optional[float] = 0.75,
retrain_from_scratch: bool = True,
optimizer: Optional[Callable[..., Any]] = None,
optimizer: Optional[Callable] = None,
learning_rate: float = 1e-3,
batch_size: int = 32,
preprocess_batch_fn: Optional[Callable[..., Any]] = None,
batch_size_predict: int = 32,
preprocess_batch_fn: Optional[Callable] = None,
epochs: int = 3,
num_workers: int = 0,
verbose: int = 0,
train_kwargs: Optional[Dict[str, Any]] = None,
device: Optional[str] = None,
dataset: Optional[Callable[..., Any]] = None,
dataloader: Optional[Callable[..., Any]] = None,
input_shape: Optional[Tuple[int, ...]] = None,
train_kwargs: Optional[dict] = None,
device: str = None,
dataset: Optional[Callable] = None,
dataloader: Optional[Callable] = None,
input_shape: Optional[tuple] = None,
data_type: Optional[str] = None,
kernel_a: Optional[nn.Module] = None,
kernel_b: Optional[nn.Module] = None,
Expand All @@ -411,15 +414,18 @@ def __init__(
update_x_ref,
preprocess_fn,
n_permutations,
batch_size_permutations,
var_reg,
reg_loss_fn,
train_size,
retrain_from_scratch,
optimizer,
learning_rate,
batch_size,
batch_size_predict,
preprocess_batch_fn,
epochs,
num_workers,
verbose,
train_kwargs,
device,
Expand Down
2 changes: 1 addition & 1 deletion cyclops/query/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class QueryInterface:

Parameters
----------
database: cyclops.orm.Database
database
Database object to create ORM, and query data.
query: cyclops.query.util.TableTypes
The query.
Expand Down
Loading