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

Remove the dependency on CPAN module List::MoreUtils #337

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

underwoo
Copy link
Member

@underwoo underwoo commented Jan 3, 2025

Description
The Perl script split_ncvars.pl uses a CPAN module List::MoreUtils for a single function uniq. The use of this function can be removed using a better method to grab the intersection of two arrays:

my @array1 = ["val1", "val2", "val3"];
my @array2 = ["val1", "val3", "val4"];
my %arr1 = map { $_ => () } @array1
my @intersection = grep { exists $arr1{$_} } @array2;

This assumes the values in @array1 and @array2 are unique. Since the arrays in split_ncvars.pl hold dimensions, the lists should be unique.

How Has This Been Tested?
The split_ncvars.pl tests are run, which indicates the output is identical to previous runs.

This PR should be taken after #331.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

underwoo and others added 30 commits December 11, 2024 19:56
The file generated to regrid is probably not correct, as the final output looks odd

My guess is that is more on the file, and not on fregrid.
Made changes to other tests to allow a single file to be used in multiple tests.
The test was removed from the Makefile already
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.

3 participants