On Mon, May 13, 2024 at 6:06 AM Juraj Linkeš <juraj.lin...@pantheon.tech> wrote:
>
> On Tue, May 7, 2024 at 3:00 PM Bruce Richardson
> <bruce.richard...@intel.com> wrote:
> >
> > On Tue, May 07, 2024 at 01:43:30PM +0100, Luca Vizzarro wrote:
> > > On 07/05/2024 13:05, Bruce Richardson wrote:
> > > > Sorry to be late to the reviews here, but since this is a countable 
> > > > value -
> > > > as you state in the cover letter- would "number" or "count" not be 
> > > > better
> > > > terms. To me, "quantity" is just a synonym of "amount", and can be used 
> > > > for
> > > > uncountable values too, e.g. "a quantity of water".
> > >
> > >
> > > Hi Bruce,
> > >
> > > The change is based on the readability and intuitiveness of the
> > > configuration file. In which case "number" could be ambiguous:
> > >
> > >   hugepages_2mb:
> > >     number: 100
> > >
> > > And here I could see "count" working:
> > >
> > >   hugepages_2mb:
> > >     count: 100
> > >
>
> We could use number_of: but that doesn't look great. Count looks fine.

I personally think that number_of is the better option of the two.
Count does work, but to me, it's not as immediately clear as
number_of; syntactically, it makes more sense.

>
> > > But since the change is propagated for consistency. "count" would no 
> > > longer
> > > be well fitting in the rest:
> > >
> > >      "description": "The count of hugepages to configure. Hugepage
> > >                      size will be the system default."
> > >
> > Whatever term is actually used, the description should definitely refer to
> > "The number of hugepages to configure".
>
> This makes sense, let's use "number of" in descriptions.

I will make the change as requested.

>
> Ideally we'd also use number in code, but it's a bit ambiguous, such as here:
> def _configure_huge_pages(self, number: int, size: int,
> force_first_numa: bool) -> None:
>
> At a first glance it's not quite clear what "number" is here.
> "number_of" would be pretty clear, but so would be "count". But using
> count would mean we're using different words with the same meaning in
> the same context, which I'd also like to avoid - this is the reason
> why I was originally ok with quantity. Now I'm not sure what the best
> option is :-)

Now that you mention it, and given Bruce's comments regarding the use
of quantity, I really like the use of number_of throughout the
framework and even the conf.yaml. Doing so will create consistency in
both the framework's internal documentation (like the 'number of'
suggestion above) and the code, removing the ambiguity that you
mentioned in some of the definitions.

Reply via email to