Skip to content

renaming backend func_info dictionary's keys - #7219

Merged
dschult merged 25 commits into
networkx:mainfrom
Schefflera-Arboricola:backend_update
Feb 25, 2024
Merged

dschult merged 25 commits into
networkx:mainfrom
Schefflera-Arboricola:backend_update

Conversation

@Schefflera-Arboricola

@Schefflera-Arboricola Schefflera-Arboricola commented Jan 11, 2024 •

Copy link
Copy Markdown
Member

Changes made :

  • added url : if we would want to link to the function's webpage page(in the future) or source code, right now in nx-parallel I've put the link to the function header(MAINT: updating backend.get_info nx-parallel#47)
  • renamedextra_parameters to additional_parameters: bcoz "extra" gives a sense that they are not necessary but "additional" gives a sense that they are an added functionality, anyways we can keep it if it's not that big of a change
  • renamed extra_docstring to additional_docs for the similar reason as above
  • removed an unused import

@Schefflera-Arboricola Schefflera-Arboricola changed the title Backend update Backend docstring updated Jan 11, 2024
@MridulS

MridulS commented Jan 17, 2024

Copy link
Copy Markdown
Member

@eriknw here is a proposal to update the variable names for passing the documentation information from the backend to networkx. What do you think?

@Schefflera-Arboricola Schefflera-Arboricola changed the title Backend docstring updated renaming backend func_info dictionary's keys Jan 18, 2024
Comment thread networkx/utils/backends.py Resolved
Comment thread networkx/utils/backends.py Resolved
@rossbar rossbar added the Dispatching Related to dispatching and backend support label Jan 31, 2024
@dschult

dschult commented Feb 21, 2024

Copy link
Copy Markdown
Member

@eriknw could you approve this PR if it is good to go from your perspective? I don't want to mess up anything you are working on that this might touch.

@eriknw

eriknw commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

I hadn't considered the connotation difference between "extra" and "additional", but, yeah, let's go with "additional".

Regarding the new names, I think having "backend_func_*" is redundant. It is already defined within function information for a backend--specifically, nx.utils.backends.backend_info[backend_name]["functions"][function_name][key].

  • So instead of "backend_func_url" as key, it could simply be "url"
    • I like adding this!
  • Similarly, "backend_func_docs" could be "doc" or "additional_doc" (doc, docs, docstring?)
    • "additional_doc*" matches naming style of "additional_parameters"

@Schefflera-Arboricola

Copy link
Copy Markdown
Member Author

Thanks for the review @eriknw !

I hadn't considered the connotation difference between "extra" and "additional", but, yeah, let's go with "additional".

“additional" is used when talking about something that is added to what already exists. And “extra” is used when talking about something that is in addition to what is necessary or required. In the case of backend arguments, it might(or might not) be that some of the backend kwargs are necessary. So, "additional" seemed more appropriate to me.

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me and Erik has given feedback on the names.
Thanks @Schefflera-Arboricola

@dschult
dschult merged commit de85e3f into networkx:main Feb 25, 2024
@jarrodmillman jarrodmillman added this to the 3.3 milestone Feb 25, 2024
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
* renamed extra_parameters to additional_parameters

* renamed extra_docstring to backend_func_docs

* added backend_func_examples and backend_func_url

* added example heading

* small edit

* style fix

* bug fix

* updated backends.py

* style fix

* code refactoring

* style fix

* Update backends.py

* updated lines

* rm backend_func_examples

* using walrus operator instead of 'if'

by @eriknw

Co-authored-by: Erik Welch <[email protected]>

* used walrus operator

* style fix

* used walrus opr

* style fix

* style fix

* Updated key names

* Updated comment

---------

Co-authored-by: Erik Welch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dispatching Related to dispatching and backend support type: Maintenance

Development

Successfully merging this pull request may close these issues.

6 participants