Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 5.77 KB

README.md

File metadata and controls

83 lines (60 loc) · 5.77 KB

Julia coding guidelines

Our recommendations for creating and maintaining reliable scientific software in Julia.

Good default choices

  • Version control: GitHub

    • de facto standard for open source software
    • provides all necessary tools for developing software in a team
    • includes Continuous Integration pipelines for continuous testing
  • Continuous integration: GitHub actions

    • comes integrated into GitHub already
    • large template library from which your workflow can be put together
  • Testing framework: Test.jl

    • standard library option for unit tests, rough analogon to Python's UnitTest library
  • Documentation: Documenter.jl

    • Markdown based
    • includes doctests for code examples
    • can be seen as an analogon to Sphinx
  • Profiling:

Tooling

Julia is a relatively young language with a smaller community than, say, Python, C++ or Matlab. As such, the selection of tools is a bit more limited. Some suggestions:

  • IDE/Code Editor:

    • Visual Studio Code: Free. The de-facto standard in the community. Provides support for linting, test discovery, formatting and more. Recommended way to go.
    • Juno: Free. Build on top of Atom. Atom is no longer supported by Microsoft/GitHub, and Juno is only maintained and wont receive new features. Only consider this if you already have an Atom-based workflow and are unwilling to switch.
    • Sublime Text: Free, but will ocassionally ask you to buy it. Syntax highlighing for Julia is available, but support for other functions is less developed than in the other two.
  • Code Formatting:

    • automatic formatting is available via VSCode's Julia plugin or through Juno.
  • Linting:

    • linting is available via VSCode's Julia plugin or through Juno.

Recommended libraries

  • Arrays and vectors (numpy analogon):

  • Linear Algebra:

    • LinearAlgebra.jl: Standard library module for linear algebra operations like matric traces, in verse, multiplication and so on.
  • Data analysis and data transformation:

    • DataFrames.jl and DataFramesMeta.jl for tabular data. Julia's analog to Pandas known from Python. Use this for higher performance.
    • Query.jl Apply common data-analysis workflows like split-apply-combine, filter etc to almost any iterable Julia datastructure. Useful when working with data that's available in various different formats.
  • Data input/output and storage:

    • HDF5.jl: For arbitrary data that should have a hierarchical organization in a single file.
    • Arrow.jl: For arbitrary data that's organized in a tabular fashion.
    • CSV.jl: For tabular, human readable data output.
  • Visualization:

    • Plots.jl: Julia Frontend with a homogeneous interface for various well known plotting packages like matplotlib, plotly or GR.
    • Makie.jl: Feature-complete plotting package in pure Julia.
    • AlgebraOfGraphics.jl Provides support for the grammar-of-graphics paradigm based on Makie.jl .
    • VegaLite.jl: Provides access to VegaLite from Julia, particularly useful for making interactive graphics.
  • Machine Learning/Deep Learning:

Have a look at the JuliaHub package database to find other packages for your use case.

Style guides and best-practices:

Much has already been written about how to write good Julia code which needs not be repeated here. Here are some starting points: