Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues around auto visualization row/column preference specification #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vyeevani
Copy link

@vyeevani vyeevani commented Aug 7, 2024

  • Fixing bugs in the named array row/column reference
  • Adding support for ordering inheritance from the preferred row and column list.

- Adding support for ordering inheritance from the preferred row and column list.
Copy link

google-cla bot commented Aug 7, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@danieldjohnson danieldjohnson left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I'm not sure I fully understand the reasons behind these changes, so it would be great if you could explain them a bit more.

Also, could you sign the CLA in the comment above?

Comment on lines +100 to +110
for column_key in self.prefers_column:
for info in array_axis_info:
if isinstance(info, NamedPositionalAxisInfo | NamedPositionlessAxisInfo | PositionalAxisInfo):
if info.logical_key() == column_key:
column_axes.append(info)

for row_key in self.prefers_row:
for info in array_axis_info:
if isinstance(info, NamedPositionalAxisInfo | NamedPositionlessAxisInfo | PositionalAxisInfo):
if info.logical_key() == row_key:
row_axes.append(info)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why change this to a double loop? I think the original loop structure will be faster and avoid unnecessary checks for axes that are not named.

Also, are you trying to add support for preferring integer axis positions? I don't think this works correctly since NamedPositionalAxisInfo has both a name and a position and the logical_key just returns one of them.

if isinstance(ax, PositionalAxisInfo | NamedPositionalAxisInfo):
return (0, -ax.axis_logical_index)
elif ax in unassigned:
if ax in unassigned:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why change this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants