Skip to content

Fix todos #8

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

Merged
merged 2 commits into from
Feb 28, 2024
Merged

Fix todos #8

merged 2 commits into from
Feb 28, 2024

Conversation

Marenz
Copy link
Contributor

@Marenz Marenz commented Feb 22, 2024

  • Update versions
  • Fix cookiecutter TODOS

@Marenz Marenz requested a review from a team as a code owner February 22, 2024 14:46
@Marenz Marenz requested review from hannah-stevenson-frequenz and removed request for a team February 22, 2024 14:46
@github-actions github-actions bot added part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) labels Feb 22, 2024
@Marenz Marenz requested a review from llucax February 22, 2024 14:56
"part:actor":
- changed-files:
- any-glob-to-any-file:
- "src/frequenz/actor/dispatch/**"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this repo scheme, I would put the actor in frequenz/dispatch/actor instead, as the python package is using the frequenz.dispatch namespace.

Copy link
Contributor Author

@Marenz Marenz Feb 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not? :P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second glance, this involved WAY more files than I anticipated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm but the client has the structure/namespace frequenz.client.dispatch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second glance, this involved WAY more files than I anticipated.

Why?

Hmm but the client has the structure/namespace frequenz.client.dispatch

Yes, and it is in a repo called frequenz-client-dispatch. I mean, we can just name this repo frequenz-actor-dispatch and have only the actor as we planned originally, I just thought it might have been a good opportunity to try this other scheme, by mixing the actor and high-level interface in one repo, and keeping the actor as an implementation detail, as we do in the SDK, where users never need to deal with the actual actors used behind the scenes, and just use higher-level functions and objects that interact with the actors for them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see the diff now, so you actually used the actor template to create this repo, not the lib template, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I used actor

On second glance, this involved WAY more files than I anticipated.

Why?

Because the name/path frequenz-actor-dispatch was all over the code, dependencies, tests, etc

I just thought it might have been a good opportunity to try this other scheme

Ah, alright. Sure, we can try.

@@ -116,12 +112,12 @@ plugins:
show_source: true
signature_crossrefs: true
import:
# TODO(cookiecutter): You might want to add other external references here
# See https://mkdocstrings.github.io/python/usage/#import for details
- https://docs.python.org/3/objects.inv
- https://frequenz-floss.github.io/frequenz-channels-python/v0.16/objects.inv
- https://frequenz-floss.github.io/frequenz-sdk-python/v0.25/objects.inv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: Oh, dammit, we need to depend on the SDK for the actor, but the SDK will depend on the actor too eventually, we need to address frequenz-floss/frequenz-sdk-python#851 sooner than I expected.

@github-actions github-actions bot added the part:tests Affects the unit, integration and performance (benchmarks) tests label Feb 26, 2024
@Marenz Marenz force-pushed the master branch 2 times, most recently from a5e578d to 7efa083 Compare February 26, 2024 16:39
@Marenz Marenz requested a review from llucax February 26, 2024 16:39
@Marenz Marenz added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Feb 26, 2024
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it seems there has been quite some confusion about the repo/python package name and general structure. The idea of calling this repo frequenz-dispatch-python instead of frequenz-actor-dispatch-python was to provide both the high-level interface and the actor in one repo (and use the normal lib repo config template).

image

Sorry about the confusion and extra work, we can of course talk about it if you don't agree and go with a different approach, it's that because you specifically pointed out that having so many repos was confusing I saw this as one place where we might reduce the number of repos, and thought it could help make things more clear instead of more confusion :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/frequenz/dispatch/__init__.py should also exist, the end user should probably do something like:

from frequenz.dispatch import Dispatcher

async def run():
    dispatcher = Dispatcher(API_CONNECTION_INFO)
    dispatcher.start()  # this will fire the actor
    dispatch_arrived = dispatcher.new_dispatches().new_receiver()
    dispatch_ready = dispatcher.ready_dispatches().new_receiver()
    # ...

I mean, in this case maybe the actor could be the same as the Dispatcher object, but so far we never put any methods in actors to make it clear the communication to actors should be done via channels instead. Maybe we should think about this possibility instead of having this in 2 layers, but this is a broader question, affecting other APIs too I guess.

Then the SDK will take care of create a global Dispatcher, so users using the SDK should do something more along the lines:

from frequenz import sdk

sdk.initialize(CONFIG)

async def run():
    dispatch_arrived = sdk.dispatcher.new_dispatches().new_receiver()
    dispatch_ready = sdk.dispatcher.ready_dispatches().new_receiver()
    # ...

@Marenz Marenz requested a review from llucax February 27, 2024 14:37
@Marenz Marenz force-pushed the master branch 3 times, most recently from 3dcf686 to 09f57f2 Compare February 28, 2024 13:20
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to fix at leas the version bump in the wrong commit, but even that is not that important, so I'll approve anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this file are in the wrong commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed. No re-approve required.

@@ -5,12 +5,12 @@
requires = [
"setuptools == 68.1.0",
"setuptools_scm[toml] == 7.1.0",
"frequenz-repo-config[actor] == 0.8.0",
"frequenz-repo-config[lib] == 0.9.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could bump directly to v0.9.1 here, but dependabot will take care of it if you don't.

Signed-off-by: Mathias L. Baumann <[email protected]>
Signed-off-by: Mathias L. Baumann <[email protected]>
@Marenz Marenz merged commit 48ff347 into frequenz-floss:v0.x.x Feb 28, 2024
@Marenz Marenz deleted the master branch February 28, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd:skip-release-notes It is not necessary to update release notes for this PR part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants