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

Expanding mask converter #108

Merged
merged 4 commits into from
Jul 14, 2022

Conversation

bernardopacini
Copy link
Collaborator

@bernardopacini bernardopacini commented Jul 11, 2022

The mask converter was previously only usable in the following scenarios:

Masking: 1 input / 1 output
Unmasking: 1 input / 1 output

In some situations, it would be useful to be able to mask several outputs from the same input, and unmask several inputs into the same output. The updated behavior is:

Masking: 1 input / n outputs
Unmasking: n inputs / 1 output

I am using this in DAFoam to redirect specific information to different components and it works as expected. However, it may be helpful to add in a few more warning messages for edge cases if you think that would be worthwhile (for example, to help a user catch overlapping input masks that would overwrite each other).

@bernardopacini bernardopacini added the enhancement New feature or request label Jul 11, 2022
@bernardopacini bernardopacini self-assigned this Jul 11, 2022
@bernardopacini
Copy link
Collaborator Author

I am not sure what happened with the failed test... has anyone seen this error before?

@timryanb
Copy link
Collaborator

timryanb commented Jul 11, 2022

Don't worry about the test @bernardopacini. There's currently a known problem (conda-forge/petsc-feedstock#147) with the conda installer for petsc that's causing the test to fail. I believe I heard from @swryan, that changing conda install ... to mamba install ... fix this problem in the short term. So this may be a work around we want to consider @kejacobson.

@kejacobson
Copy link
Collaborator

We can talk about the conda/mambc petsc issue in the telecon today.

@bernardopacini, Tim has a unit test for the original mask converter functionality. Can you add one for your multiple variable version?

@bernardopacini
Copy link
Collaborator Author

bernardopacini commented Jul 12, 2022

I added a test following @timryanb's format and added a warning for the unmasking case where values could conflict. The PR should be good to go, though if we prefer to wait until the Conda issue is sorted out we can hold off on merging this for now (as of now I think I am the only one using the multiple mask functionality).

@kejacobson
Copy link
Collaborator

Bernardo, since Tim approved the changes and petsc conda issue doesn't look to be resolved, you can try Tim's suggestion of mamba install here and here.

@swryan
Copy link
Contributor

swryan commented Jul 13, 2022

Bernardo, since Tim approved the changes and petsc conda issue doesn't look to be resolved, you can try Tim's suggestion of mamba install here and here.

For reference.. the PR that should fix the conda issue is here.
In the OpenMDAO workflow, we used setup-miniconda to install mamba which you can see here.

      - name: Setup mamba
        uses: conda-incubator/setup-miniconda@v2
        with:
          python-version: ${{ matrix.PY }}
          mamba-version: "*"
          channels: conda-forge,defaults
          channel-priority: true)

Copy link
Collaborator

@joanibal joanibal left a comment

Choose a reason for hiding this comment

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

This looks good to me as well. Thanks for incorporating that test.

@minrk
Copy link

minrk commented Jul 13, 2022

petsc metadata issue should be fixed now.

@timryanb
Copy link
Collaborator

As @minrk says, the problem seems to be resolved now and the CI is working again. Think we can go ahead and merge as-is

@timryanb timryanb merged commit d80d0cd into OpenMDAO:main Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants