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

Add tilde filename expansion to rfits/wfits #209

Closed
wants to merge 5 commits into from

Conversation

d-lamb
Copy link
Member

@d-lamb d-lamb commented Sep 29, 2017

We use the same tilde expansion that is used in PDL::AutoLoader,
so there should be no (additional) portability issues.

It would probably be better to put this into a new IO.pm module
and then all the PDL::IO::* modules could use it.

We use the same tilde expansion that is used in PDL::AutoLoader,
so there should be no (additional) portability issues.

It would probably be better to put this into a new IO.pm module
and then all the PDL::IO::* modules could use it.
@coveralls
Copy link

Coverage Status

Coverage decreased (-11.2%) to 51.956% when pulling ec19dba on fits_tilde_expansion into ade05f6 on master.

Previously the first element of a list provided to 'cat' was used
to set the type of the output piddle.  Now it uses the "highest"
type if passed a mixed-type list.

Also added some tests for this new behavior, and improved the
documentation for cat, append, and glue to better highlight the
differences between then.
@coveralls
Copy link

coveralls commented Oct 3, 2017

Coverage Status

Coverage decreased (-10.5%) to 52.609% when pulling 2ad3e4f on fits_tilde_expansion into ade05f6 on master.

Instead of the pwnam etc which is not super portable, we can
use glob(~) to get the home directory.  That should be more portable.

Alternatively we could add a dependency and use File::HomeDir.
@wchristian wchristian closed this Mar 1, 2018
@wchristian wchristian deleted the fits_tilde_expansion branch March 1, 2018 20:35
@wchristian wchristian restored the fits_tilde_expansion branch March 1, 2018 20:50
@wchristian wchristian deleted the fits_tilde_expansion branch March 1, 2018 23:00
@wchristian wchristian restored the fits_tilde_expansion branch March 1, 2018 23:15
@mohawk2 mohawk2 reopened this Mar 2, 2018
t/fits.t Outdated
# Check that tilde expansion works
my $tildefile = cfile('~',"PDL-IO-FITS-test_$$.fits");
eval { sequence(3,5,2)->wfits($tildefile); };
ok(!$@, "wfits tilde expansion didn't fail");
Copy link
Member

Choose a reason for hiding this comment

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

Since we're using Test::More these days, you could do this:

is $@, '', "wfits tilde expansion didn't fail";

which has the added benefit of immediately telling you what $@ was if there was an error!

Copy link
Member

Choose a reason for hiding this comment

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

We're also using Test::Exception, so that could even be

use Test::Exception;
lives_ok {
    sequence(3,5,2)->wfits($tildefile)
} "wfits tilde expansion didn't fail";

@mohawk2
Copy link
Member

mohawk2 commented Mar 8, 2018

This looks Ok to me. Unless anyone can see a reason not to, why not merge?

@wchristian wchristian closed this Mar 9, 2018
@wchristian wchristian deleted the fits_tilde_expansion branch March 9, 2018 06:05
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.

None yet

5 participants