diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8388ce656..fe0dca3bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.8.0 hooks: - id: ruff-format types_or: [python, pyi, jupyter] @@ -17,7 +17,7 @@ repos: types_or: [python, pyi, jupyter] args: [--fix] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.42.0 + rev: v0.43.0 hooks: - id: markdownlint-fix - repo: https://github.com/kynan/nbstripout diff --git a/src/muse/agents/__init__.py b/src/muse/agents/__init__.py index 069f1c2ef..d59b95029 100644 --- a/src/muse/agents/__init__.py +++ b/src/muse/agents/__init__.py @@ -2,9 +2,9 @@ "AbstractAgent", "Agent", "InvestingAgent", - "factory", "agents_factory", "create_agent", + "factory", ] from muse.agents.agent import AbstractAgent, Agent, InvestingAgent diff --git a/src/muse/decisions.py b/src/muse/decisions.py index b75b2a446..98292c5e7 100644 --- a/src/muse/decisions.py +++ b/src/muse/decisions.py @@ -27,15 +27,15 @@ def weighted_sum(objectives: Dataset, parameters: Any, **kwargs) -> DataArray: """ __all__ = [ - "register_decision", - "mean", - "weighted_sum", - "lexical_comparison", - "retro_lexical_comparison", "epsilon_constraints", + "factory", + "lexical_comparison", + "mean", + "register_decision", "retro_epsilon_constraints", + "retro_lexical_comparison", "single_objective", - "factory", + "weighted_sum", ] from collections.abc import Mapping, MutableMapping, Sequence from typing import ( diff --git a/src/muse/demand_share.py b/src/muse/demand_share.py index b6a29b591..e049f312a 100644 --- a/src/muse/demand_share.py +++ b/src/muse/demand_share.py @@ -38,12 +38,12 @@ def demand_share( """ __all__ = [ - "new_and_retro", + "DEMAND_SHARE_SIGNATURE", "factory", + "new_and_retro", "register_demand_share", "unmet_demand", "unmet_forecasted_demand", - "DEMAND_SHARE_SIGNATURE", ] from collections.abc import Hashable, Mapping, MutableMapping, Sequence from typing import ( diff --git a/src/muse/filters.py b/src/muse/filters.py index 1f459e75c..03db5b7d0 100644 --- a/src/muse/filters.py +++ b/src/muse/filters.py @@ -74,20 +74,20 @@ def search_space_initializer( """ __all__ = [ + "compress", + "currently_existing_tech", + "currently_referenced_tech", "factory", - "register_filter", - "register_initializer", "identity", + "initialize_from_technologies", + "maturity", "reduce_asset", - "similar_technology", + "register_filter", + "register_initializer", "same_enduse", "same_fuels", - "currently_existing_tech", - "currently_referenced_tech", - "maturity", - "compress", + "similar_technology", "with_asset_technology", - "initialize_from_technologies", ] from collections.abc import Mapping, MutableMapping, Sequence diff --git a/src/muse/hooks.py b/src/muse/hooks.py index 7456b3937..df21bb388 100644 --- a/src/muse/hooks.py +++ b/src/muse/hooks.py @@ -1,15 +1,15 @@ """Pre and post hooks on agents.""" __all__ = [ - "register_initial_asset_transform", - "register_final_asset_transform", - "noop", + "asset_merge_factory", "clean", - "old_assets_only", + "housekeeping_factory", "merge_assets", "new_assets_only", - "housekeeping_factory", - "asset_merge_factory", + "noop", + "old_assets_only", + "register_final_asset_transform", + "register_initial_asset_transform", ] from collections.abc import Mapping, MutableMapping from typing import Callable, Union diff --git a/src/muse/interactions.py b/src/muse/interactions.py index 091311cf4..c999196b5 100644 --- a/src/muse/interactions.py +++ b/src/muse/interactions.py @@ -15,10 +15,10 @@ """ __all__ = [ - "register_interaction_net", - "register_agent_interaction", "factory", "new_to_retro_net", + "register_agent_interaction", + "register_interaction_net", "transfer_assets", ] diff --git a/src/muse/investments.py b/src/muse/investments.py index bc5baed61..a95cec19d 100644 --- a/src/muse/investments.py +++ b/src/muse/investments.py @@ -42,10 +42,10 @@ def investment( """ __all__ = [ + "INVESTMENT_SIGNATURE", "adhoc_match_demand", "cliff_retirement_profile", "register_investment", - "INVESTMENT_SIGNATURE", ] from collections.abc import Mapping, MutableMapping from typing import ( diff --git a/src/muse/objectives.py b/src/muse/objectives.py index 2bb3b7ba4..207c9e499 100644 --- a/src/muse/objectives.py +++ b/src/muse/objectives.py @@ -48,18 +48,18 @@ def comfort( """ __all__ = [ - "register_objective", + "capacity_to_service_demand", + "capital_costs", "comfort", "efficiency", - "fixed_costs", - "capital_costs", "emission_cost", + "equivalent_annual_cost", + "factory", + "fixed_costs", "fuel_consumption_cost", "lifetime_levelized_cost_of_energy", "net_present_value", - "equivalent_annual_cost", - "capacity_to_service_demand", - "factory", + "register_objective", ] from collections.abc import Mapping, MutableMapping, Sequence diff --git a/src/muse/outputs/__init__.py b/src/muse/outputs/__init__.py index fc7e80a54..88c01d1f2 100644 --- a/src/muse/outputs/__init__.py +++ b/src/muse/outputs/__init__.py @@ -1,3 +1,3 @@ -__all__ = ["sector", "sinks", "register_output_sink"] +__all__ = ["register_output_sink", "sector", "sinks"] from muse.outputs import sector, sinks from muse.outputs.sinks import register_output_sink diff --git a/src/muse/production.py b/src/muse/production.py index ac5e9ac46..5a21775bc 100644 --- a/src/muse/production.py +++ b/src/muse/production.py @@ -31,12 +31,12 @@ def production( """ __all__ = [ + "PRODUCTION_SIGNATURE", "demand_matched_production", "factory", "maximum_production", "register_production", "supply", - "PRODUCTION_SIGNATURE", ] from collections.abc import Mapping, MutableMapping from typing import Any, Callable, Union, cast diff --git a/src/muse/readers/csv.py b/src/muse/readers/csv.py index 09cd84d6a..2de5143fc 100644 --- a/src/muse/readers/csv.py +++ b/src/muse/readers/csv.py @@ -1,19 +1,19 @@ """Ensemble of functions to read MUSE data.""" __all__ = [ - "read_technodictionary", - "read_io_technodata", - "read_initial_assets", - "read_technologies", + "read_attribute_table", + "read_csv_agent_parameters", "read_csv_timeslices", "read_global_commodities", - "read_timeslice_shares", - "read_csv_agent_parameters", - "read_macro_drivers", + "read_initial_assets", "read_initial_market", - "read_attribute_table", - "read_regression_parameters", + "read_io_technodata", + "read_macro_drivers", "read_presets", + "read_regression_parameters", + "read_technodictionary", + "read_technologies", + "read_timeslice_shares", ] from collections.abc import Sequence diff --git a/src/muse/regressions.py b/src/muse/regressions.py index 41471bb15..b6f461712 100644 --- a/src/muse/regressions.py +++ b/src/muse/regressions.py @@ -10,14 +10,14 @@ from xarray import DataArray, Dataset __all__ = [ - "factory", "Exponential", "ExponentialAdj", + "Linear", "Logistic", - "Loglog", "LogisticSigmoid", - "Linear", + "Loglog", "endogenous_demand", + "factory", "register_regression", ] diff --git a/src/muse/sectors/__init__.py b/src/muse/sectors/__init__.py index 94370517b..3aaf68d7d 100644 --- a/src/muse/sectors/__init__.py +++ b/src/muse/sectors/__init__.py @@ -30,12 +30,12 @@ """ __all__ = [ + "SECTORS_REGISTERED", "AbstractSector", - "Sector", - "PresetSector", "LegacySector", + "PresetSector", + "Sector", "register_sector", - "SECTORS_REGISTERED", ] from muse.sectors.abstract import AbstractSector from muse.sectors.legacy_sector import LegacySector diff --git a/src/muse/timeslices.py b/src/muse/timeslices.py index 001152bfe..96b8f2fc2 100644 --- a/src/muse/timeslices.py +++ b/src/muse/timeslices.py @@ -1,12 +1,12 @@ """Timeslice utility functions.""" __all__ = [ - "reference_timeslice", "aggregate_transforms", "convert_timeslice", - "timeslice_projector", - "setup_module", + "reference_timeslice", "represent_hours", + "setup_module", + "timeslice_projector", ] from collections.abc import Mapping, Sequence