question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Requesting docstring clarification on semantics of planned_units()

See original GitHub issue

The following things are not obvious from the docstring of the model.app.planned_units() method

  • Does planned unit apply to both scaling up and scaling down changes.
  • Does planned unit reflect the state of juju command line issued uptil the point in time when planned units method was invoked.

For example suppose a charm has 30 deployed units and the system administrator invokes juju scale-application <charm> 1. This will result in RelationDepartedEvents for each of the 29 departing units. Will planned_units() when invoked in all of those RelationDepartedEvents yield the result 1 or will it yield 29, then 28 and so on.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pengalecommented, Mar 2, 2022

Planned units represents the state of the controller’s model as of the the current hook invocation.

It should reflect both scale up and scale down.

It will reflect the results of a CLI command after that command has been run, any resultant hooks have been processed and sent to the controller, and the agent has updated its local copy of the model with that in the controller. Most of the time, this is transparent to the operator who ran the CLI command – you have to do work to catch the charm in the act of updating its controller state after you run an action.

I’ll work up a PR to refactor the docs so that they reflect this.

0reactions
pengalecommented, Mar 21, 2022

Code merged. Closing issue 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docstring Semantics - Docutils
PEP 257, Docstring Conventions, sketches out some guidelines, but does not get into methodology details. I haven't explored documentation methodology more ...
Read more >
Introduction to docstring
2017-03-24. The docstring package is a package for R that provides the ability to display something analagous to Python's docstrings within R.
Read more >
Documenting Python APIs with docstrings
We use reStructuredText to mark up and give semantic meaning to text in docstrings. ReStructuredText is lightweight enough to read in raw form, ......
Read more >
Python Docstring: Documenting And Introspecting Functions
This tutorial explains what is Python Docstring and how to use it to document Python functions with examples.
Read more >
PEP 257 – Docstring Conventions
This PEP documents the semantics and conventions associated with Python docstrings. Rationale. The aim of this PEP is to standardize the high- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found