Skip to content

Commit

Permalink
Improve query ops API, update deps (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit110 authored Sep 7, 2023
1 parent 6ea5b5d commit 5b1c745
Show file tree
Hide file tree
Showing 20 changed files with 2,199 additions and 1,565 deletions.
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/wretry.action@v1.0.36
with:
action: codecov/codecov-action@v3.1.3
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/wretry.action@v1.0.36
with:
action: codecov/codecov-action@v3.1.3
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

0 comments on commit 5b1c745

Please sign in to comment.