Skip to content

Conversation

@RHammond2
Copy link
Collaborator

This PR creates the method ArraySystemDesign.create_layout_df() consisting of the layout data frame creation steps originally in save_layout(). To maintain backwards compatibility, save_layout simply calls the creation step, then proceeds with the save logic. By splitting this into separate methods the user can now obtain the layout data frame without having to save it to a file.

@RHammond2 RHammond2 requested a review from nRiccobo November 6, 2025 22:32
@RHammond2 RHammond2 added the enhancement Enhancement to an existing feature label Nov 6, 2025
Copy link
Collaborator

@nRiccobo nRiccobo left a comment

Choose a reason for hiding this comment

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

Just two minor details to address. Otherwise, it good to me. Much cleaner with a separate method for the layout_df.

ValueError
Raised if ``folder`` is not one of "cables" or "plant".
"""
if folder not in ("cables", "plant"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be folder.lower()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only if folder will be converted to lower case first, otherwise it would break later usage with ORBIT. If that's desired, then I can update it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably not the most pressing. It seems like the user would be familiar with the folder names prior to saving anyways...

layout_df = self.create_layout_df()
data = [layout_df.columns] + layout_df.to_numpy().tolist()
print(
f"Saving custom array CSV to: <library_path>/cables/{save_name}.csv" # noqa: E501
Copy link
Collaborator

Choose a reason for hiding this comment

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

{folder}. If folder is set to plant, the print statement would tell me the wrong file location.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a good catch! I didn't really look at this part, but this is a great time to implement more useful logging.

@RHammond2 RHammond2 merged commit 0caf4db into WISDEM:dev Nov 21, 2025
14 checks passed
@RHammond2 RHammond2 deleted the feature/provide-layout-without-save branch November 21, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants