PySDM icon indicating copy to clipboard operation
PySDM copied to clipboard

New Particulator creation flow

Open abulenok opened this issue 2 years ago • 7 comments

reasons:

  • avoid modifying env and backend by Builder::init(..., env, backend)

user-perspective:

  • backend = Backend()
  • Env(backend)
  • create list of dynamics
  • create dictionary of attributes (old init_attributes logic should go )
  • create list of products
  • Particulator(env, dynamics, attributes, products)

steps:

  • [ ] remove Builder class?
  • [ ] release 3.0

abulenok avatar Nov 03 '23 14:11 abulenok

idea for decorator name: @pysdm.product_prototype (with a method instantiate(backend) returning a Product instance)

slayoo avatar Nov 06 '23 10:11 slayoo

Stale issue message

github-actions[bot] avatar Jan 05 '24 13:01 github-actions[bot]

it is probably Backend(env) what we need rather than Env(backend)! The reason is that backend should leverage the information on dimensionality of the environment and, e.g., avoid multi-threading for cell-wise operations if there is just one cell. Similarly, the displacement code will get much simpler and will no longer need repeated if-else statements checking the dimensionality at runtime on every call.

slayoo avatar Mar 17 '24 01:03 slayoo

... or Backend(n_dims: int) ?

slayoo avatar Mar 17 '24 01:03 slayoo

idea for decorator name: @pysdm.product_prototype (with a method instantiate(backend) returning a Product instance)

Done in #1370

slayoo avatar Aug 02 '24 05:08 slayoo

dynamic-reuse issue addressed in #1372 with a new @register_dynamic decorator

slayoo avatar Aug 02 '24 11:08 slayoo

environment reuse issue addressed in #1373 with a new @register_environment decorator

slayoo avatar Aug 02 '24 12:08 slayoo