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

Fix single_reference=True #43

Merged
merged 4 commits into from
Nov 27, 2023
Merged

Fix single_reference=True #43

merged 4 commits into from
Nov 27, 2023

Conversation

pllim
Copy link
Member

@pllim pllim commented Nov 21, 2023

Fix #42

@pllim pllim added the bug label Nov 21, 2023
@pllim pllim added this to the v0.7.0 milestone Nov 21, 2023
@pllim pllim requested a review from astrofrog November 21, 2023 16:49
@pllim
Copy link
Member Author

pllim commented Nov 21, 2023

Nope does not appear to work.

@pllim pllim marked this pull request as draft November 21, 2023 16:57
Comment on lines 313 to 318
filename = item.name + '.' + extension
filename = item.function + '.' + extension
if not single_reference:
filename = filename.replace('[', '_').replace(']', '_')
filename = filename.replace('_.' + extension, '.' + extension)
Copy link
Member

Choose a reason for hiding this comment

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

I think this should work:

        if filename is None:
            if single_reference:
                filename = item.function + '.' + extension
            else:
                filename = item.name + '.' + extension
                filename = filename.replace('[', '_').replace(']', '_')
                filename = filename.replace('_.' + extension, '.' + extension)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, thanks! I updated the patch and added you as co-author of the commit.

Co-authored-by: Conor MacBride <conor@macbride.me>
@pllim pllim marked this pull request as ready for review November 21, 2023 21:14
@pllim
Copy link
Member Author

pllim commented Nov 21, 2023

Yay, CI is green now. Thanks!

I have no expertise nor interest to add a unit test but @astrofrog is welcome to push to my branch if he wants a test. 😉

@astrofrog
Copy link
Member

I've added a regression test, which unfortunately shows that the fix here doesn't work

@astrofrog
Copy link
Member

@ConorMacBride - for some reason the function name is ending up being wrapper so this doesn't work quite right.

@astrofrog
Copy link
Member

Ok I got it to work, it was item.originalname we wanted - I'll go ahead and merge and release once CI passes, since this is needed for reproject.

@astrofrog astrofrog merged commit f392f6f into astropy:main Nov 27, 2023
16 checks passed
@pllim pllim deleted the fix-single-ref branch November 27, 2023 17:07
@pllim
Copy link
Member Author

pllim commented Nov 27, 2023

Thanks, @astrofrog !

@bsipocz bsipocz modified the milestones: v0.7.0, v0.6.1 Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: single_reference=True not working currently
4 participants