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

What should be split into submodules? #495

Closed
ali-ramadhan opened this issue Oct 23, 2019 · 8 comments · Fixed by #591
Closed

What should be split into submodules? #495

ali-ramadhan opened this issue Oct 23, 2019 · 8 comments · Fixed by #591
Labels
cleanup 🧹 Paying off technical debt

Comments

@ali-ramadhan
Copy link
Member

Probably makes sense to split output_writers.jl, diagnostics.jl, and poisson_solvers.jl into submodules.

They're turning into megafiles that will benefit from being split into smaller logical chunks.

And this will probably only get worse with time.

@ali-ramadhan ali-ramadhan added the cleanup 🧹 Paying off technical debt label Oct 23, 2019
@glwagner
Copy link
Member

Yes, let's not have megafiles.

I think the question is what shouldn't be in a submodule!

Fields would make good one. It could even be split into a separate package, eg StaggeredFields.jl.

@glwagner
Copy link
Member

glwagner commented Oct 23, 2019

Probably we should just start with the most important modularizations and work our way to the less important ones. I'd say output writers and poisson solvers are most important. We need the poisson solver functionality written more generally and abstracted a bit more because, if it were, we could use a poisson solver for implicit time-stepping

@glwagner
Copy link
Member

Probably Grids will need a submodule when we have more than one.

@glwagner
Copy link
Member

This is related to issue #456

@ali-ramadhan
Copy link
Member Author

ali-ramadhan commented Oct 23, 2019

Ah sorry I remember we talked about this but forgot there's already an existing issue!

Diagnostics and output writers could probably already be split into submodules.

Maybe the grids can be modularized at the same time as the vertically stretched grid is introduced, while the Poisson solvers can be modularized when the new FACR solver (PR #306) is introduced (which might nuke some existing solvers too).

@glwagner
Copy link
Member

I am wondering if physics should also go to submodules, eg Buoyancy, Coriolis, and soon, SurfaceWaves.

I think this will help us keep our parameter structs concise. For example, FPlane is a bit confusing when it appears in isolation. But Coriolis.FPlane is clear. Also, the word "Buoyancy" appears a lot. If all buoyancy-related things are encapsulated within submodules, naming becomes easier.

We can stop exporting so many names at the top-level, and instead export the submodules. So a user will write

buoyancy = Buoyancy.Seawater()

or

coriolis = Coriolis.FPlane()

or

surface_waves = SurfaceWaves.UniformStokesDrift()

What do we think?

@glwagner
Copy link
Member

By the way, we might take some inspiration from Documenter.jl's structure:

https://github.com/JuliaDocs/Documenter.jl/tree/master/src

@ali-ramadhan
Copy link
Member Author

Yeah I think it's starting to make a lot of sense for Buoyancy, Coriolis, and SurfaceWaves to have their own modules.

Actually I also think that boundary_conditions.jl is becoming painful to parse and edit and would also benefit from becoming a submodule with multiple files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup 🧹 Paying off technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants