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

compiler: Add opkwargs property to ArgumentsMap #2142

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

ccuetom
Copy link
Contributor

@ccuetom ccuetom commented Jun 8, 2023

PR adds opkwargs property to ArgumentsMap. opkwargs returns a dictionary containing compiler, language and platform keyword arguments usable by downstream operators.

temp_registry = {v: k for k, v in compiler_registry.items()}
compiler = temp_registry[self.compiler.__class__]

return {'platform': platform, 'compiler': compiler, 'language': self.language}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not self.compiler and self.platform

opkwargs is a bit vague since it only returns the "language" part

Copy link
Contributor Author

Choose a reason for hiding this comment

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

self.compiler and self.platform contain Compiler and Platform objects respectively instead of the original str arguments passed to the operator. Downstream operators will expect arguments passed to them to be str's

Is there a Devito word that encompasses platform, compiler, and language to use a more descriptive method name?

Copy link
Contributor

@FabioLuporini FabioLuporini left a comment

Choose a reason for hiding this comment

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

I think this is OK

@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #2142 (2819421) into master (772243b) will decrease coverage by 0.02%.
The diff coverage is 28.57%.

@@            Coverage Diff             @@
##           master    #2142      +/-   ##
==========================================
- Coverage   87.09%   87.08%   -0.02%     
==========================================
  Files         223      223              
  Lines       39871    39878       +7     
  Branches     5170     5172       +2     
==========================================
+ Hits        34726    34728       +2     
- Misses       4568     4573       +5     
  Partials      577      577              
Impacted Files Coverage Δ
devito/operator/operator.py 88.50% <28.57%> (-0.78%) ⬇️

@mloubout mloubout merged commit 3353683 into devitocodes:master Jun 28, 2023
@ccuetom ccuetom deleted the add-opkwargs branch July 5, 2023 14:47
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.

3 participants