forked from frequenz-floss/frequenz-sdk-python
-
Couldn't load subscription status.
- Fork 0
Update microgrid client to v0.3 #7
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
Open
matthias-wende-frequenz
wants to merge
1,139
commits into
v0.x.x
Choose a base branch
from
update_client
base: v0.x.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
When constructing `ComponentPoolStatusTracker` objects. Signed-off-by: Sahas Subramanian <[email protected]>
In the component status tracking parts of the power distributor. Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
This helps better leverage the new instruction specialization feature of Python. Signed-off-by: Sahas Subramanian <[email protected]>
When SoC is close to 0.0 or 100.0, it will be exactly 0.0 or 100.0.
- Refactor component status tracking into its own package. - Use `timedelta`s instead of `float`s for duration in component status trackers. - Convert `ComponentStatusTracker`s into `BackgroundService`s
When the PowerManager receives a `PartialFailure`, in many cases, resending the request would fix it, because the power distributor would have new information on how to redistribute differently. But this doesn't always work, for example in single battery locations or if all batteries are in an UNCERTAIN state, in which case the power distributor has to retry with the same batteries. For this reason, if we don't have a limit on such retries from the PowerManager, we'd get into an infinite loop that doesn't have any delay inbetween retries. Signed-off-by: Sahas Subramanian <[email protected]>
This is used to identify proposals that are too old, so that they can be removed from consideration when the PowerManager calculates target power. Signed-off-by: Sahas Subramanian <[email protected]>
In the matryoshka algorithm, this method is implemented to delete proposals that haven't been replaced/updated in the last `max_proposal_age`. Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
The PowerManager doesn't have a way to identify if an actor that sent a proposal is still active. It needs to know that to know when to drop proposals from a given sender. With this PR, the resending of proposals by actors also functions as a heart-beat between the actors and the power manager. If an actor hasn't sent a new proposal in 60 seconds, the latest available proposal from that actor is also removed from the power manager.
This is necessary because `None` is a valid value that could have been sent through a channel, so the having a `None` value might not mean that the cache is empty. Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
When the charger is not in an error state, this would return whether an EV is connected to the charger or not. Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
…-floss#848) - A new method `is_ev_connected` to analyze the states better - New fields to represent active power bounds for ev chargers
The previous commit has introduced the possibility for exceptions to be raised from the implementation of `latest_value` property. Properties should ideally not raise, so we replace it with the `get` method. Signed-off-by: Sahas Subramanian <[email protected]>
…requenz-floss#846) This is necessary because `None` is a valid value that could have been sent through a channel, so the having a `None` value might not always mean that the cache is empty. Closes frequenz-floss#820
Signed-off-by: Mathias L. Baumann <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
The producer and consumer power formulas are now implemented in their own logical component classes. Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
This affects the PowerManager, PowerDistributor and PowerWrapper. The `component_type` paramater now also has a default value of `None`. Signed-off-by: Sahas Subramanian <[email protected]>
Co-authored-by: Leandro Lucarella <[email protected]> Signed-off-by: Sahas Subramanian <[email protected]>
Co-authored-by: Leandro Lucarella <[email protected]> Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Also use `logging.exception` to log broad exceptions Signed-off-by: Sahas Subramanian <[email protected]>
Updates the requirements on [pydoclint](https://github.com/jsh9/pydoclint), [polars](https://github.com/pola-rs/polars), [black](https://github.com/psf/black), [markdown](https://github.com/Python-Markdown/markdown), [mkdocs-material](https://github.com/squidfunk/mkdocs-material), [mkdocstrings[python]](https://github.com/mkdocstrings/mkdocstrings), [frequenz-repo-config[lib]](https://github.com/frequenz-floss/frequenz-repo-config-python), [mypy](https://github.com/python/mypy), [types-markdown](https://github.com/python/typeshed), [types-setuptools](https://github.com/python/typeshed), [pylint](https://github.com/pylint-dev/pylint), [frequenz-repo-config[extra-lint-examples]](https://github.com/frequenz-floss/frequenz-repo-config-python), [pytest-mock](https://github.com/pytest-dev/pytest-mock), [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio), [async-solipsism](https://github.com/bmerry/async-solipsism), [pytest](https://github.com/pytest-dev/pytest) and [hypothesis](https://github.com/HypothesisWorks/hypothesis) to permit the latest version. Also do some extra upgrades coming from the upgrade of repo-config from v0.7 to v0.9. Updates `pydoclint` from 0.3.8 to 0.4.1 - [Release notes](https://github.com/jsh9/pydoclint/releases) - [Changelog](https://github.com/jsh9/pydoclint/blob/main/CHANGELOG.md) - [Commits](jsh9/pydoclint@0.3.8...0.4.1) Updates `polars` from 0.20.2 to 0.20.18 - [Release notes](https://github.com/pola-rs/polars/releases) - [Commits](pola-rs/polars@py-0.20.2...py-0.20.18) Updates `black` from 24.1.1 to 24.3.0 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](psf/black@24.1.1...24.3.0) Updates `markdown` from 3.5.1 to 3.6 - [Release notes](https://github.com/Python-Markdown/markdown/releases) - [Changelog](https://github.com/Python-Markdown/markdown/blob/master/docs/changelog.md) - [Commits](Python-Markdown/markdown@3.5.1...3.6) Updates `mkdocs-material` from 9.5.3 to 9.5.16 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](squidfunk/mkdocs-material@9.5.3...9.5.16) Updates `mkdocstrings[python]` from 0.24.0 to 0.24.1 - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](mkdocstrings/mkdocstrings@0.24.0...0.24.1) Updates `frequenz-repo-config[lib]` from 0.7.4 to 0.9.1 - [Release notes](https://github.com/frequenz-floss/frequenz-repo-config-python/releases) - [Changelog](https://github.com/frequenz-floss/frequenz-repo-config-python/blob/v0.x.x/RELEASE_NOTES.md) - [Commits](frequenz-floss/frequenz-repo-config-python@v0.7.4...v0.9.1) Updates `mypy` from 1.8.0 to 1.9.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.8.0...1.9.0) Updates `types-markdown` from 3.5.0.20240129 to 3.6.0.20240316 - [Commits](https://github.com/python/typeshed/commits) Updates `types-setuptools` from 69.0.0.20240125 to 69.2.0.20240317 - [Commits](https://github.com/python/typeshed/commits) Updates `pylint` from 3.0.3 to 3.1.0 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](pylint-dev/pylint@v3.0.3...v3.1.0) Updates `frequenz-repo-config[extra-lint-examples]` from 0.7.4 to 0.9.1 - [Release notes](https://github.com/frequenz-floss/frequenz-repo-config-python/releases) - [Changelog](https://github.com/frequenz-floss/frequenz-repo-config-python/blob/v0.x.x/RELEASE_NOTES.md) - [Commits](frequenz-floss/frequenz-repo-config-python@v0.7.4...v0.9.1) Updates `pytest-mock` from 3.12.0 to 3.14.0 - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest-mock@v3.12.0...v3.14.0) Updates `pytest-asyncio` from 0.23.3 to 0.23.6 - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](pytest-dev/pytest-asyncio@v0.23.3...v0.23.6) Updates `async-solipsism` from 0.5 to 0.6 - [Commits](bmerry/async-solipsism@0.5...0.6) Updates `pytest` from 7.4.4 to 8.1.1 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Commits](pytest-dev/pytest@7.4.4...8.1.1) Updates `hypothesis` from 6.92.1 to 6.100.0 - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.92.1...hypothesis-python-6.100.0)
Signed-off-by: Leandro Lucarella <[email protected]>
These additional logs will help in understanding why certain microgrid components, such as meters, fail to provide relevant samples for resampling. Signed-off-by: Daniel Zullo <[email protected]>
To add an entry in the `Enhancements` session related to the new warning message that is logged when no relevant samples are found in a component for resampling. Signed-off-by: Daniel Zullo <[email protected]>
…#923) These additional logs will help in understanding why certain microgrid components, such as meters, fail to provide relevant samples for resampling.
Signed-off-by: Matthias Wende <[email protected]>
The microgrid API client 0.3.0 introduces reactive power to the `InverterData`, `MeterData` and `EvChargerData` classes. This commit adds the missing reactive power. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Matthias Wende <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TemperaturequantityQuantityobjectsQuantityobjects asfloatsisclose()method forQuantityobjectsTemperaturequantitytemperature_maxfields totemperatureTemperatureMetricswithSample[Temperature]battery_pool.temperaturefrequenz-api-microgridto version 0.15.1ComponentCategoryfrom frequenz-api-common packagecomponent_typefrom component metadataBoundsPowerobjects to represent power bounds in battery poolConfigManagingActorConfigManagingActorconf_filetoconfig_pathand acceptpathlib.Pathcheck-for-changed-filesactionPower.from_watts(0)withPower.zero()_get_boundsmethod in PowerDistributingActorto_protobufmethod in power distribution testsPowerDistributingActor._check_requestcreate_componentsmethod outside test classprint()is_close_to_zero()instead ofmath.isclose(..., abs_tol=...)a < b < ccomparisonconsumer_power()not working certain configurations.OutOfBound->OutOfBoundsBackgroundServiceabstract base classActorabstract base classActorclass inactor.run()disable_actor_auto_restartfixtureConfigManagingActorto theActorclass_ActorInfogeneric_data_pipeline.initialize()asyncComponentMetricsResamplingActorto theActorclass_run()docs forComponentMetricsResamplingActorDataSourcingActorto theActorclassPowerDistributingActorto theActorclassMovingWindowaBackgroundServiceactor_auto_restart_oncefixtureCancelledErrorinwait()BackgroundServicetestsBackgroundServiceandActorBackgroundService.start()syncIntroductionfrom the replay file\nto the end of the replay fileComponentno_incrementaloptionnoxsessions in paralleldarglintconfigurationflake8mypyconfiguration topyproject.tomlnot x in ywithx not in ySelfimport_symbol for unused variable#for commentsnoqa: DOC502frequencysupportNonefrom battery pool methods (Nonevalues from BatteryPool's SoC/Capacity methods frequenz-floss/frequenz-sdk-python#545)section-indexplugin withnavigation.indexesnox-cross-archtest for push eventsnoxmatrix jobsnox-cross-arch-alljob commentmkdocstrings_autoapi.pytodocs/_scriptsmkdocs.ymlwatchsectionmkdocs-section-indexpackage_slugify()to the top-levelactormodule documentationIntroductiontoUser GuideTutorialssection after theUser Guide_DataPipelineto managePowerManagingActorinstance_add_bounds_trackerin the tests for the PowerManagingActoradjust_poweras a parameter to BatteryPool's power methodsBatteryPool.power_boundsto_system_power_boundstarget_powerandavailable_boundsbased on priorityhandle_proposaltoget_target_power_send_reportto_send_reports_add_bounds_trackersync, to fix race conditionReceiverFetcherinterface to type data stream methodsReceiverFetcherthat uses an underlying channel registrypower_distribution_resultsfrom the battery pooltest_power_managing_actor.py->test_matryoshka.pyavailable_boundstoinclusion_boundsin PowerManager ReportsNonevalues in PowerManager reporting streamsBoundsclasses in BatteryPool/PowerManager with a single oneexclusion_boundsthrough PowerManager reporting streamsNonevalues in BatteryPool control methodsBoundsobject inset_power, instead of separate valuesset_powercall order in battery pool tests, before checking-sys.maxsize - 1as default priority for BatteryPoolpower_bounds->power_statusand update docsset_power/(dis)charge->propose_{power,(dis)charge}nameas parameter in call tomicrogrid.battery_pool()BatteryPool->BatteryPoolReferenceStoreBatteryPoolWrapper->BatteryPoolReceiverFetcherto make it visible in documentation_RegistryReceiverFetcherfromGeneric[T]BatteryPool.propose_powerdocstring to be less ambiguousget_target_powertocalculate_target_powerinclude_broken_batteriesin control commands_get_all()to_get_all_from_map()glossaryto take optional link textpathlib.Path.relative_towithos.path.relpathfrequenz.sdk.{_formula_engine => formula_engine}Component Graphentry in the glossaryFormulaEngineclassFormulaEngine3PhaseclassComponentGraphfrom its own moduleBatteryPoolinstances should be createdLogicalMeterinstances should be createdEVChargerPooldocumentationclientdocs that it is a low-level interfaceset_resend_latestmethod toChannelRegistryclassresent_latest=TrueforBatteryPool.power_status's channelstarget_powerStatefulTesterPowerManagingActor'sReporttype through theBatteryPool_clamp_to_boundsto clamp power values to both sidesBatteryPool.PowerMetrics->SystemBoundsbattery_pool.SystemBoundstotimeseries._base_typesPowerManager.Reportwith protocol classBatteryPoolReportReportimplementation and interface from a protocol classSystemBoundsclasskw_onlyBatteryStatus→ComponentStatus_BatteryStatusChannelHelper→_ComponentStatusChannelHelperBatteryPoolStatus→ComponentPoolStatusTrackerComponentStatus→ComponentPoolStatusStatus→ComponentStatusEnumcomponent_idin updates fromBatteryStatusTrackerSetPowerResultclass to _component_status.pyComponentStatusTrackerinComponentPoolStatusTrackerSetPowerResult_all_battery_status→_component_pool_status_trackerRequest.batteries→component_idsin PowerDistributingActorcollections.abc.Setand notsetin PowerDistributor resultsbatteries→componentsin PowerDistributor's result types{battery → component_pool}_status_senderDistributionAlgorithm→BatteryDistributionAlgorithm_component_managersmodule docstringComponentGraph.components()parameters to be pluralPeekablein test_client.py withReceiversPeekables from docs inMicrogridApiClientLatestValueCachethat can be used to replacePeekablePeekablewithLatestValueCachein EVChargerPoolPeekableinPowerDistributorwithLatestValueCachefrequency()Quantitiesinstead ofFrequencyMockResamplerzero handlingMockResamplerto treatnanasNoneGridFrequencyquantity conversionGridFrequencyproduceNonewhen the value isnanNone/nantypingMockMicrogridan async context managerMockMicrogridas an async context managertypingmultple timesGenericChannelRegistrytype-awareChannelRegistrymethodsReceiverFetchercompatible withBroadcastChannelRegistryQuantityT_component_statussub packagecomponent_idsas an immutable settimedeltas rather than asfloatsComponentStatusTrackers to beBackgroundServicesiscloseto 100.0creation_timeattribute toProposalsdrop_old_proposalsmethod in PowerManager algorithmsLatestValueCacheto denote if the cache is emptyLatestValueCacheto follow its new APIEVChargeData.is_ev_connectedmethodLatestValueCache.latest_valueproperty with agetmethodfrequenz-api-microgridupdatefrequenz-repo-configupdatetime-machineupdateFormulaEnginemkdocstringsoptionpylintversion_new()convenience method toQuantityQuantity.base_valueis always a floatfrom_stringtests limitationstype: ignorefor__mul____mul__Percentagetests__mul__()tests forfloatBatteryManagerinterface functions as@overrideBlockingStatusto a separate private moduleBlockingStatusto havekw_onlyconstructorPower{Distributor/Manager}creation toPowerWrapperclassComponentCategoryto identify PowerManager typefrequenz-client-microgridConnectionas if they were tuplesFusetypes where appropriateFuse_api_clientmodulefrequenz-channelsversion to v1.0.0-rc1EventTypeseparately in uses ofFileWatcherMergewithmergefor constructing andMergerfor typingMergeNamedinbattery_poolexample withmergeTimersSelected.valuewithSelected.messagecovariantgenerics inReceiverFetcherandLatestValueCachenameas a kw argument when creating channels and receiverslimitas a kw argument when creating channels and receiversabc.Setfor component_ids in EVChargerPoolbenchmark_ringbuffer.pyBatteryPool.battery_ids→component_idsReceiverFetcherto be compatible withBroadcastchannels_mockspower distributor test fixture component-agnosticComponentCategoryparameter to thePowerDistributingActorEVChargerPool.power__eq__method for_power_managing.ProposalSortedSetwith asetin theMatryoshkaalgorithmmock_resampler's task is cancelledreceive_timeoutto tests.utils package, so it can be reusedEVChargerStatusTrackerimplementationEVChargerManagerthat can plug into the PowerDistributorpower_statusmethod toEVChargerPoolpropose_powermethod to EVChargerPool*poolcalls are made with the same parameters*poolcreation methodsEVChargerPooltoo-many-return-statementspylint checkpytestto v8mypyexclusion forsybilpylintchecks also done byflake8stopmethod forLatestValueCachePVManagerimplementationPowerDistributorto support PV invertersSystemBoundsTrackerfor PV inverters_system_power_boundsmethodPVPoolthroughmicrogrid.pv_pool()PowerManagerPowerManagerfrom thePVPoolpowerformula fromlogical_metertoPVPoolstopmethod toBatteryPoolcomponent_categoryandcomponent_typeparameters kw-only*Poolconstructor related docs from the class docs