-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Explicitly begin(), not connect(), to sql engine
As of sqlalchemy 2.0, default behavior for a connection is to auto-rollback unless explicitly committed or part of a transaction (begun with begin()). closes #56 Add a test to ensure variants have unique definition remove Experiment type
- Loading branch information
1 parent
3fba4a6
commit b1e6eed
Showing
8 changed files
with
74 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
from collections import defaultdict | ||
|
||
data_config = {"length": {"test": 5}} | ||
|
||
meth_config = {"metric": {"test": "len"}} | ||
|
||
# lookup any parameter, any variant: always none | ||
lookup_default: dict[str, dict[str, None]] = defaultdict( | ||
lambda: defaultdict(lambda: None) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
from logging import getLogger | ||
|
||
import numpy as np | ||
from numpy.typing import NBitBase | ||
from numpy.typing import NDArray | ||
|
||
from mitosis._typing import ExpResults | ||
|
||
|
||
class Klass: | ||
@staticmethod | ||
def gen_data( | ||
length: int, extra: bool = False | ||
) -> dict[str, NDArray[np.floating[NBitBase]] | bool]: | ||
def gen_data(length: int, extra: bool = False) -> ExpResults: | ||
getLogger(__name__).info("This is run every time") | ||
getLogger(__name__).debug("This is run in debug mode only") | ||
|
||
return {"data": np.ones(length, dtype=np.float_), "extra": extra} | ||
return { | ||
"data": np.ones(length, dtype=np.float_), | ||
"extra": extra, | ||
"main": None, | ||
} # type: ignore | ||
|
||
|
||
def do_nothing(*args, **kwargs) -> ExpResults: | ||
"""An experiment step that accepts anything and produces nothing""" | ||
return {"main": None} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters