Skip to content

Conversation

vchuravy
Copy link
Member

I just ran into the footgun that in tests or in Documenter trixi_include uses the wrong module.
Using a macro we can query the calling module with __module__ and allow for "prettier" usage.

I personally prefer macros for "magic" functionality like trixi_include

Copy link
Member

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

Nice idea. Can you also export the macro, please?

Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Thanks, I like the idea. Could you please

  • export the macro to fix CI
  • add a test for the error path in the macro
  • add a test with multiple keyword arguments

? Programming macros is always a bit scary in Julia compared to normal functions, so I would like to have a bit better test coverage for it to make it easier for people working with the code in the future.

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