diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..40f95cd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,221 @@ +# This global .gitattributes file is adhered to via command: +# git config --global core.attributesfile ~/git-global/.gitattributes_global +# +# Use this file on every device where git development is done. + + +### +### Auto detect text files and perform LF normalization +### +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +### +### The above will handle all files NOT found below. +### From https://github.com/alexkaratarakis/gitattributes +### + +### gitattributes/C++.gitattributes d3b93d4 on Jun 20, 2018 +#sources +*.c text diff=cpp +*.cc text diff=cpp +*.cxx text diff=cpp +*.cpp text diff=cpp +*.c++ text diff=cpp +*.hpp text diff=cpp +*.h text diff=cpp +*.h++ text diff=cpp +*.hh text diff=cpp + +# Compiled Object files +*.slo binary +*.lo binary +*.o binary +*.obj binary + +# Precompiled Headers +*.gch binary +*.pch binary + +# Compiled Dynamic libraries +*.so binary +*.dylib binary +*.dll binary + +# Compiled Static libraries +*.lai binary +*.la binary +*.a binary +*.lib binary + +# Executables +*.exe binary +*.out binary +*.app binary + +# Other +############## +*.exe binary +*.num binary +*.xls binary +*.xlsx binary +*.XLS binary +*.XLSX binary +bin/ binary + +### gitattributes/Common.gitattributes 9b38185 on Jun 9, 2018 +# Common settings that generally should always be used with your language specific settings + +# Auto detect text files and perform LF normalization +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +# +# The above will handle all files NOT found below +# + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain +*.md text diff=markdown +*.adoc text +*.textile text +*.tex text diff=tex +*.mustache text +*.csv text +*.tab text +*.tsv text +*.sql text + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as an asset (binary) by default. If you want to treat it as text, +# comment-out the following line and uncomment the line after. +*.svg binary +#*.svg text +*.eps binary + +### gitattributes/Java.gitattributes c08b42f on Mar 29, 2017 +# Handle line endings automatically for files detected as text +# and leave all files detected as binary untouched. +* text=auto + +# +# The above will handle all files NOT found below +# +# These files are text and should be normalized (Convert crlf => lf) +*.css text +*.df text +*.htm text +*.html text +*.java text +*.js text +*.json text +*.jsp text +*.jspf text +*.jspx text +*.properties text +*.sh text +*.tld text +*.txt text +*.tag text +*.tagx text +*.xml text +*.yml text +*.toml text + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.class binary +*.dll binary +*.ear binary +*.gif binary +*.ico binary +*.jar binary +*.jpg binary +*.jpeg binary +*.png binary +*.so binary +*.war binary + +### gitattributes/Matlab.gitattributes d2539f6 on Dec 3, 2015 +# Basic .gitattributes for a MATLAB repo. +# This template includes Simulink and MuPAD extensions, in addition +# to the MATLAB extensions. + +# Source files +# ============ +*.m text +*.mu text + +# Caution: *.m also matches Mathematica packages. + +# Binary files +# ============ +*.p binary +*.mex* binary +*.fig binary +*.mat binary +*.mdl binary +*.slx binary +*.mdlp binary +*.slxp binary +*.sldd binary +*.mltbx binary +*.mlappinstall binary +*.mlpkginstall binary +*.mn binary + +### gitattributes/Python.gitattributes cbd3af4 on Jun 20, 2018 +# Basic .gitattributes for a python repo. + +# Source files +# ============ +*.pxd text diff=python +*.py text diff=python +*.py3 text diff=python +*.pyw text diff=python +*.pyx text diff=python + +# Binary files +# ============ +*.db binary +*.p binary +*.pkl binary +*.pyc binary +*.pyd binary +*.pyo binary + +# Note: .db, .p, and .pkl files are associated +# with the python modules ``pickle``, ``dbm.*``, +# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` +# (among others). + +### gitattributes/R.gitattributes 80aacc1 on Aug 22, 2015 +# Basic .gitattributes for a R repo. + +# Source files +# ============ +*.Rdata text +*.rdb binary +*.rds binary +*.Rd text +*.Rdx binary +*.Rmd text +*.R text + + diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..d288319 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,37 @@ +name: CI +on: + push: + branches: + - main + tags: '*' + pull_request: +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + + - name: Run tests + run: > + julia --project=. --color=yes test/runtests.jl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8712726 --- /dev/null +++ b/.gitignore @@ -0,0 +1,416 @@ +################################################################################ +# DrWatson Project Structure # +################################################################################ + +# Folders to ignore - files may be too large, too many, etc. NOTE: EDIT IF NEEDED. +/data +/videos +/plots +/notebooks +/_research + +################################################################################ +# Julia # +################################################################################ + +# Files generated by invoking Julia with --code-coverage +*.jl.cov +*.jl.*.cov + +# Files generated by invoking Julia with --track-allocation +*.jl.mem + +# System-specific files and directories generated by the BinaryProvider and +# BinDeps packages. +# They contain absolute paths, and so should not be committed +deps/deps.jl +deps/build.log +deps/downloads/ +deps/usr/ +deps/src/ + +# Build artifacts for creating documentation generated by the Documenter package +docs/build/ +docs/site/ + +################################################################################ +# Jupyter Notebook # +################################################################################ + +.ipynb_checkpoints +*/.ipynb_checkpoints/* + +################################################################################ +# Microsoft Office # +################################################################################ + +*.tmp + +# Word temporary +~$*.doc* + +# Word Auto Backup File +Backup of *.doc* + +# Excel temporary +~$*.xls* + +# Excel Backup File +*.xlk + +# PowerPoint temporary +~$*.ppt* + +################################################################################ +# LaTeX # +################################################################################ + +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules will exclude image files for figures, et cetera... +# *.ps +# *.eps +# *.pdf + +## Generated if empty string given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +### LaTeX Patch ### +# glossaries +*.glstex + +################################################################################ +# Operating systems # +################################################################################ + +######################################## +# Linux # +######################################## + +*~ + +# temporary files which can be created if a process still has a handle open of +# a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +######################################## +# macOS # +######################################## + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +######################################## +# Windows # +######################################## + +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +## Acknowledgements +# Many thanks to `https://gitignore.io/`, written and maintained by Joe Blau, which contributed much material to this gitignore file. diff --git a/Project.toml b/Project.toml index ca06a6a..548a585 100644 --- a/Project.toml +++ b/Project.toml @@ -1,2 +1,6 @@ +name = "template_project" +[compat] +julia = "1.11.1" +DrWatson = "2.18.0" [deps] DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1" diff --git a/README.md b/README.md new file mode 100644 index 0000000..70f5417 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# template_project + +This code base is using the [Julia Language](https://julialang.org/) and +[DrWatson](https://juliadynamics.github.io/DrWatson.jl/stable/) +to make a reproducible scientific project named +> template_project + +To (locally) reproduce this project, do the following: + +0. Download this code base. Notice that raw data are typically not included in the + git-history and may need to be downloaded independently. +1. Open a Julia console and do: + ``` + julia> using Pkg + julia> Pkg.add("DrWatson") # install globally, for using `quickactivate` + julia> Pkg.activate("path/to/this/project") + julia> Pkg.instantiate() + ``` + +This will install all necessary packages for you to be able to run the scripts and +everything should work out of the box, including correctly finding local paths. + +You may notice that most scripts start with the commands: +```julia +using DrWatson +@quickactivate "template_project" +``` +which auto-activate the project and enable local path handling from DrWatson. diff --git a/scripts/intro.jl b/scripts/intro.jl new file mode 100644 index 0000000..a5ec196 --- /dev/null +++ b/scripts/intro.jl @@ -0,0 +1,19 @@ +using DrWatson +@quickactivate "template_project" + +# Here you may include files from the source directory +include(srcdir("dummy_src_file.jl")) + +println( +""" +Currently active project is: $(projectname()) + +Path of active project: $(projectdir()) + +Have fun with your new project! + +You can help us improve DrWatson by opening +issues on GitHub, submitting feature requests, +or even opening your own Pull Requests! +""" +) diff --git a/src/dummy_src_file.jl b/src/dummy_src_file.jl new file mode 100644 index 0000000..ec8235f --- /dev/null +++ b/src/dummy_src_file.jl @@ -0,0 +1,11 @@ +""" + dummy_project_function(x, y) → z +Dummy function for illustration purposes. +Performs operation: +```math +z = x + y +``` +""" +function dummy_project_function(x, y) + return x + y +end diff --git a/test/runtests.jl b/test/runtests.jl new file mode 100644 index 0000000..c14b3b9 --- /dev/null +++ b/test/runtests.jl @@ -0,0 +1,17 @@ +using DrWatson, Test +@quickactivate "template_project" + +# Here you include files using `srcdir` +# include(srcdir("file.jl")) + +# Run test suite +println("Starting tests") +ti = time() + +@testset "template_project tests" begin + @test 1 == 1 +end + +ti = time() - ti +println("\nTest took total time of:") +println(round(ti/60, digits = 3), " minutes")