trixi-framework / trixi-framework/Trixi.jl

Use enum for directions

Open
#405 3 comments 0 reactions 0 assignees View on GitHub
discussion low-priority
Dominant language
Julia
Stars
731
Forks
166
Avg merge
2d 18h
Merged PRs (30d)
25

Description

As stated in the docs,
> The directions are numbered as `1 => -x, 2 => +x, 3 => -y, 4 => +y, 5 => -z, 6 => +z`.

As a Java developer, I would want to use an enum instead. This way, the direction would be clear to a reader without reading the docs first. Also, this would be safer, as it doesn't allow other values than 1 and 2 for one dimension, 1 to 4 for two, ...
I just checked, and it seems like enums in Julia work like enums in Java.

Would this be a good idea here (apart from the fact that a lot of code would need to be refactored) and if not, why?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.