DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: Luca Vizzarro <Luca.Vizzarro@arm.com>
Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com,
	jspewock@iol.unh.edu,  probb@iol.unh.edu,
	paul.szczepanek@arm.com, npratte@iol.unh.edu, dev@dpdk.org
Subject: Re: [PATCH v1] dts: rename execution to test run
Date: Tue, 23 Apr 2024 14:10:16 +0200	[thread overview]
Message-ID: <CAOb5WZbcTCxKw+Bx8t-VOAvWAyKN2PpomY2ceZVZMacVE3dn9Q@mail.gmail.com> (raw)
In-Reply-To: <c53c1f1a-57b5-448c-9878-44916f874725@arm.com>

On Tue, Apr 23, 2024 at 12:58 PM Luca Vizzarro <Luca.Vizzarro@arm.com> wrote:
>
> Hi Juraj!
>
> I am not fussed about naming but I am certainly in favour of making
> things less confusing, so I am happy with this change.
>

Yes, using execution in this context is very confusing. The main thing
with this patch is to find the best replacement. If you're ok with the
new name or can't think of a (even potentially) better name, that's
all we need. :-)

> On 19/04/2024 09:51, Juraj Linkeš wrote:
> >       @staticmethod
> >       def from_dict(
> > -        d: ExecutionConfigDict,
> > +        d: TestRunConfigDict,
> >           node_map: dict[str, Union[SutNodeConfiguration | TGNodeConfiguration]],
> > -    ) -> "ExecutionConfiguration":
> > +    ) -> "TestRunConfiguration":
> > <snip>
> > -    def copy_and_modify(self, **kwargs) -> "ExecutionConfiguration":
> > +    def copy_and_modify(self, **kwargs) -> "TestRunConfiguration":
> > <snip>
> >       @staticmethod
> >       def from_dict(d: ConfigurationDict) -> "Configuration":
>
> Unrelated, but spark for an improvement. I have noticed these, not sure
> if there are more instances in the code. Shouldn't from_dict be a
> @classmethod instead of @staticmethod. In which case you could also use:
>
>    from typing_extensions import Self
>
> to replace all the class literals, example:
>
>    @classmethod
>    def from_dict(cls, d, node_map): -> Self:
>      ...
>      return cls(...) # initialise class with cls
>
>    ...
>
>    def copy_and_modify(self, **kwargs) -> Self:

There are many of these from_dict methods. Maybe we should just put
the logic into __init__ and not use the constructors generated by the
dataclass decorator. Or we could also use your suggestion. I don't
know that they should be class methods, it doesn't make that much of a
difference (is there an appreciable one? Apart from the nicer typing).
It's worth making a bugzilla ticket for this though.

  reply	other threads:[~2024-04-23 12:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  8:51 Juraj Linkeš
2024-04-23 10:58 ` Luca Vizzarro
2024-04-23 12:10   ` Juraj Linkeš [this message]
2024-04-30 16:56 ` Jeremy Spewock
2024-05-02 12:05 ` Luca Vizzarro
2024-06-07  8:24 ` [PATCH v2] " Juraj Linkeš
2024-06-07  8:38 ` [PATCH v3] " Juraj Linkeš

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOb5WZbcTCxKw+Bx8t-VOAvWAyKN2PpomY2ceZVZMacVE3dn9Q@mail.gmail.com \
    --to=juraj.linkes@pantheon.tech \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=dev@dpdk.org \
    --cc=jspewock@iol.unh.edu \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).