Skip to content

moving Builder logic into Particulator::__init__() and removing builder.py#1885

Open
KmazuR-afk wants to merge 2 commits into
open-atmos:mainfrom
KmazuR-afk:builder_update_v2
Open

moving Builder logic into Particulator::__init__() and removing builder.py#1885
KmazuR-afk wants to merge 2 commits into
open-atmos:mainfrom
KmazuR-afk:builder_update_v2

Conversation

@KmazuR-afk
Copy link
Copy Markdown
Collaborator

No description provided.

@KmazuR-afk
Copy link
Copy Markdown
Collaborator Author

I suggest making request_attribute() a private helper method for now and replacing external calls with a requested_attributes tuple passed to build() or we could consider removing self.req_attr_names entirely and constructing the requested attribute names locally inside build(). @slayoo ?

@KmazuR-afk
Copy link
Copy Markdown
Collaborator Author

Another question is - what to do with register() methods in another classes e.g. Displacement?
In Displacement.register(), we currently have:

def register(self, builder):
    builder.request_attribute("relative fall velocity")
    self.particulator = builder.particulator

What should be the approach here - moving it to build method whenever class Displacement is used?

@slayoo
Copy link
Copy Markdown
Member

slayoo commented Jun 4, 2026

thanks!

@KmazuR-afk, a viable recaftor could likely involve:

  • creating a Particulator::__init__() which combines (almost as-is) the logic of Builder::__init__() and Builder::build()
  • then, the register() calls are handled as they were
  • the requested_attributes tuple as argument seems a good plan (and making a private __request_attribute())

@KmazuR-afk
Copy link
Copy Markdown
Collaborator Author

I moved most, if not all, of the Builder setup logic into Particulator. With this change, Particulator.__init__() now performs the full initialization previously split between Builder.__init__() and Builder.build().

I am not entirely sure whether this is the desired final architecture, but in this form builder.py could likely be removed entirely, or kept only as a temporary compatibility wrapper.

Additionally, I made the setup-related arguments in Particulator.__init__() keyword-only by adding * to the signature.

@slayoo
Copy link
Copy Markdown
Member

slayoo commented Jun 4, 2026

🚀 !
removing builder.py is exactly what we're only waiting for with the v3 release! :)
Thanks!

@slayoo slayoo changed the title Removing request_attribute() as public method from Builder moving Builder logic into Particulator::__init__() and removing builder.py Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants