Skip to content

Commit

Permalink
Ensure that some methods and functions are called with named paramete…
Browse files Browse the repository at this point in the history
…rs (#48)
  • Loading branch information
GianlucaFicarelli authored Sep 30, 2024
1 parent efc39bd commit a428941
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 6 deletions.
13 changes: 9 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
Changelog
=========

Version 0.11.5
Version 0.12.0
--------------

Bug Fixes
~~~~~~~~~
Breaking changes
~~~~~~~~~~~~~~~~

- Skip simulations with empty path in the simulation campaign configuration (fix regression in blueetl 0.8.0).
- Ensure that some methods and functions are called with named parameters. In particular, the following public methods require named parameters:

- ``blueetl.analysis.run_from_file()``
- ``blueetl.extract.report.ReportExtractor.from_simulations()``
- ``blueetl.repository.Repository.__init__()``
- ``blueetl.repository.FilteredRepository.__init__()``

Version 0.11.4
--------------
Expand All @@ -17,6 +21,7 @@ Bug Fixes
~~~~~~~~~

- Fix tests with libsonata 0.1.28.
- Skip simulations with empty path in the simulation campaign configuration (fix regression in blueetl 0.8.0).


Version 0.11.3
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ ignored-modules = ["bluepy"]
# Maximum number of arguments for function / method.
max-args = 8
# Maximum number of positional arguments for function / method.
max-positional-arguments = 10
max-positional-arguments = 5
# Maximum number of attributes for a class (see R0902).
max-attributes = 40
# Maximum number of boolean expressions in an if statement (see R0916).
Expand Down
1 change: 1 addition & 0 deletions src/blueetl/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ def show(self):

def run_from_file(
analysis_config_file: StrOrPath,
*,
seed: Optional[int] = 0,
extract: bool = True,
calculate: bool = True,
Expand Down
1 change: 1 addition & 0 deletions src/blueetl/apps/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
@click.option("-i", "--interactive/--no-interactive", help="Start an interactive IPython shell.")
@click.option("-v", "--verbose", count=True, help="-v for INFO, -vv for DEBUG")
def run(
*,
analysis_config_file,
seed,
extract,
Expand Down
1 change: 1 addition & 0 deletions src/blueetl/extract/compartment_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CompartmentReport(ReportExtractor):
@classmethod
def _load_values(
cls,
*,
simulation: Simulation,
population: Optional[str],
gids,
Expand Down
1 change: 1 addition & 0 deletions src/blueetl/extract/neurons.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def _get_property_names(neuron_classes: dict[str, NeuronClassConfig]) -> list[st


def _load_cells(
*,
circuit: Circuit,
property_names: list[str],
cells_cache: CellsCache,
Expand Down
3 changes: 3 additions & 0 deletions src/blueetl/extract/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def calculate_window_slice(rec) -> WindowSlice:
@abstractmethod
def _load_values(
cls,
*,
simulation: Simulation,
population: Optional[str],
gids,
Expand All @@ -83,6 +84,7 @@ def _load_values(
@classmethod
def from_simulations(
cls: type[ReportExtractorT],
*,
simulations: Simulations,
neurons: Neurons,
windows: Windows,
Expand Down Expand Up @@ -122,6 +124,7 @@ def from_simulations(


def _merge_filter_func(
*,
task_index: int,
key: NamedTuple,
df_list: list[pd.DataFrame],
Expand Down
1 change: 1 addition & 0 deletions src/blueetl/extract/soma_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class SomaReport(ReportExtractor):
@classmethod
def _load_values(
cls,
*,
simulation: Simulation,
population: Optional[str],
gids,
Expand Down
1 change: 1 addition & 0 deletions src/blueetl/extract/spikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def _assign_window(cls, df: pd.DataFrame, rec) -> pd.DataFrame:
@classmethod
def _load_values(
cls,
*,
simulation: Simulation,
population: Optional[str],
gids,
Expand Down
2 changes: 2 additions & 0 deletions src/blueetl/extract/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _load_dynamic_gids(


def _load_dynamic_spikes(
*,
simulation: Simulation,
population: Optional[str],
gids: np.ndarray,
Expand Down Expand Up @@ -145,6 +146,7 @@ def _validate(cls, df: pd.DataFrame) -> None:
@classmethod
def _load_records_from_resolver(
cls,
*,
name: str,
win: str,
simulation_id: int,
Expand Down
2 changes: 2 additions & 0 deletions src/blueetl/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def _calculate_new(


def _user_func_wrapper(
*,
task_index: int,
key: NamedTuple,
neurons_df: pd.DataFrame,
Expand Down Expand Up @@ -446,6 +447,7 @@ def _user_func_wrapper(


def _merge_filter_func(
*,
task_index: int,
key: NamedTuple,
df_list: list[pd.DataFrame],
Expand Down
3 changes: 2 additions & 1 deletion src/blueetl/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class Repository:

def __init__(
self,
*,
simulations_config: SimulationCampaign,
extraction_config: ExtractionConfig,
cache_manager: CacheManager,
Expand Down Expand Up @@ -391,7 +392,7 @@ def needs_filter(self, name: str) -> bool:
class FilteredRepository(Repository):
"""FilteredRepository class."""

def __init__(self, parent: Repository, simulations_filter: dict[str, Any]) -> None:
def __init__(self, *, parent: Repository, simulations_filter: dict[str, Any]) -> None:
"""Initialize the object using the given dict of DataFrames.
Filtered dataframes are never written to disk.
Expand Down

0 comments on commit a428941

Please sign in to comment.