You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're currently using a custom pre-commit lint hook specifically designed for formatting Python files in Ivy's frontend, as detailed in our documentation and implemented in our lint hook repository. This formatter organizes the code into two main sections: helpers and main, sorting functions alphabetically within these sections based on a specific regex pattern.
The task at hand is to adapt and extend this formatter to cater to Ivy's backend and the Ivy Stateful API. Unlike the frontend, where the division is simply between helpers and main functions, the backend and stateful API require a more nuanced approach to accommodate various headers that categorize functions into either the "Array API Standard" or "Extras", among others. This distinction is crucial as it helps in segregating functions that adhere to the standard from those that do not, with new functions being added regularly.
For the backend and Ivy Stateful API, the goal is to maintain the integrity of these headers, such as "Array API Standard", "Autograd", "Optimizer Steps", "Optimizer Updates", "Array Printing", "Retrieval", "Conversions", "Memory", etc., ensuring they remain unchanged. The proposed approach involves sorting functions alphabetically within each section defined by these headers, thereby preserving the organizational structure and clarity regarding the functionalities of each section.
The desired structure for updating the formatter should adhere to the following template, ensuring a clear and organized codebase:
This structure not only ensures functions are easily locatable and the code remains clean but also respects the categorization of functionalities as per Ivy's standards. The approach was previously attempted in a pull request (#22830), which serves as a reference for implementing these changes.
Hey @soma2000-lang
Looks like you are already working on another issue. Could you please choose one issue you want to work on and unassign yourself and delete the comment @ivy-leaves assign me from the issue. Thanks
We're currently using a custom pre-commit lint hook specifically designed for formatting Python files in Ivy's frontend, as detailed in our documentation and implemented in our lint hook repository. This formatter organizes the code into two main sections:
helpers
andmain
, sorting functions alphabetically within these sections based on a specific regex pattern.The task at hand is to adapt and extend this formatter to cater to Ivy's backend and the Ivy Stateful API. Unlike the frontend, where the division is simply between
helpers
andmain
functions, the backend and stateful API require a more nuanced approach to accommodate various headers that categorize functions into either the "Array API Standard" or "Extras", among others. This distinction is crucial as it helps in segregating functions that adhere to the standard from those that do not, with new functions being added regularly.For the backend and Ivy Stateful API, the goal is to maintain the integrity of these headers, such as "Array API Standard", "Autograd", "Optimizer Steps", "Optimizer Updates", "Array Printing", "Retrieval", "Conversions", "Memory", etc., ensuring they remain unchanged. The proposed approach involves sorting functions alphabetically within each section defined by these headers, thereby preserving the organizational structure and clarity regarding the functionalities of each section.
The desired structure for updating the formatter should adhere to the following template, ensuring a clear and organized codebase:
This structure not only ensures functions are easily locatable and the code remains clean but also respects the categorization of functionalities as per Ivy's standards. The approach was previously attempted in a pull request (#22830), which serves as a reference for implementing these changes.
If you have any questions feel free to reach out to @NripeshN or @KareemMAX
The text was updated successfully, but these errors were encountered: