{"id":866,"date":"2021-01-14T14:44:41","date_gmt":"2021-01-14T13:44:41","guid":{"rendered":"https:\/\/yellotab.se\/x056\/?p=866"},"modified":"2021-01-14T14:45:04","modified_gmt":"2021-01-14T13:45:04","slug":"filstruktur-for-olika-typer-av-kod","status":"publish","type":"post","link":"https:\/\/yellotab.se\/x056\/2021\/01\/14\/filstruktur-for-olika-typer-av-kod\/","title":{"rendered":"Filstruktur f\u00f6r olika typer av kod"},"content":{"rendered":"<h2 id=\"directory-structure-for-projects\">Directory structure for projects<\/h2>\n<ul>\n<li>A good starting point is to keep all files associated with a project in a\u00a0<strong>single folder<\/strong><\/li>\n<li><strong>Different projects<\/strong>\u00a0should have\u00a0<strong>separate folders<\/strong><\/li>\n<li>Use\u00a0<strong>consistent and informative directory structure<\/strong><\/li>\n<li>If you need to separate public\/private\/secret, separate these by folder (and Git repo)<\/li>\n<li>Add a\u00a0<strong>README file<\/strong>\u00a0to describe the project and instructions on reproducing the results<\/li>\n<li>Talk to others in the project about what you do and write it down<\/li>\n<li>Your mileage may vary: it\u2019s not a one-size-fits-all<\/li>\n<li>When software is reused in several projects it can make sense to put them in own repo<\/li>\n<\/ul>\n<h3>Struktur f\u00f6r molnbaserad kod<\/h3>\n<p>&nbsp;<\/p>\n<h3>Struktur f\u00f6r textbaserade project<\/h3>\n<p>&nbsp;<\/p>\n<h3>Struktur f\u00f6r kompilerad kod<\/h3>\n<p>&nbsp;<\/p>\n<p>A project directory can look something like this:<\/p>\n<div class=\"language-shell highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"codehilite\"><code class=\"\" data-line=\"\">project_name\/\n\u251c\u2500\u2500 README.md             &lt;span class=&quot;c&quot;&gt;# overview of the project&lt;\/span&gt;\n\u251c\u2500\u2500 data\/                 &lt;span class=&quot;c&quot;&gt;# data files used in the project&lt;\/span&gt;\n\u2502   \u251c\u2500\u2500 README.md         &lt;span class=&quot;c&quot;&gt;# describes where data came from&lt;\/span&gt;\n\u2502   \u2514\u2500\u2500 sub-folder\/       &lt;span class=&quot;c&quot;&gt;# may contain subdirectories&lt;\/span&gt;\n\u251c\u2500\u2500 processed_data\/       &lt;span class=&quot;c&quot;&gt;# intermediate files from the analysis&lt;\/span&gt;\n\u251c\u2500\u2500 manuscript\/           &lt;span class=&quot;c&quot;&gt;# manuscript describing the results&lt;\/span&gt;\n\u251c\u2500\u2500 results\/              &lt;span class=&quot;c&quot;&gt;# results of the analysis (data, tables, figures)&lt;\/span&gt;\n\u251c\u2500\u2500 src\/                  &lt;span class=&quot;c&quot;&gt;# contains all code in the project&lt;\/span&gt;\n\u2502   \u251c\u2500\u2500 LICENSE           &lt;span class=&quot;c&quot;&gt;# license for your code&lt;\/span&gt;\n\u2502   \u251c\u2500\u2500 requirements.txt  &lt;span class=&quot;c&quot;&gt;# software requirements and dependencies&lt;\/span&gt;\n\u2502   \u2514\u2500\u2500 ...\n\u2514\u2500\u2500 doc\/                  &lt;span class=&quot;c&quot;&gt;# documentation for your project&lt;\/span&gt;\n    \u251c\u2500\u2500 index.rst\n    \u2514\u2500\u2500 ...\n<\/code><\/pre>\n<\/div>\n<\/div>\n<hr \/>\n<h2 id=\"tracking-source-code-data-and-results\">Tracking source code, data, and results<\/h2>\n<ul>\n<li>All code is version controlled and goes in the\u00a0<code class=\"\" data-line=\"\">src\/<\/code>\u00a0or\u00a0<code class=\"\" data-line=\"\">source\/<\/code>\u00a0directory<\/li>\n<li>Include appropriate LICENSE file and information on software requirements<\/li>\n<li>You can also version control data files or input files under\u00a0<code class=\"\" data-line=\"\">data\/<\/code><\/li>\n<li>If data files are too large (or sensitive) to track, untrack them using\u00a0<code class=\"\" data-line=\"\">.gitignore<\/code><\/li>\n<li>Intermediate files from the analysis are kept in\u00a0<code class=\"\" data-line=\"\">processed_data\/<\/code><\/li>\n<li>Consider using Git tags to mark specific versions of results (version submitted to a journal, dissertation version, poster version, etc.):\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"codehilite\"><code class=\"\" data-line=\"\">&lt;span class=&quot;nv&quot;&gt;$ &lt;\/span&gt;git tag &lt;span class=&quot;nt&quot;&gt;-a&lt;\/span&gt; thesis-submitted &lt;span class=&quot;nt&quot;&gt;-m&lt;\/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;this is the submitted version of my thesis&quot;&lt;\/span&gt;\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"reproducible-publications\">Reproducible publications<\/h2>\n<ul>\n<li>Git can be used to collaborate on manuscripts written in, e.g., LaTeX and other text-based formats but other tools exist:\n<ul>\n<li><a href=\"https:\/\/www.overleaf.com\/\">Overleaf<\/a>\u00a0(has Git integration)<\/li>\n<li><a href=\"https:\/\/www.authorea.com\/\">Authorea<\/a>\u00a0(apparently also has Git integration)<\/li>\n<li>Google Docs can be a good alternative<\/li>\n<\/ul>\n<\/li>\n<li>Many tools exist to assist in making scholarly output reproducible:\n<ul>\n<li><a href=\"https:\/\/github.com\/benmarwick\/rrtools\">rrtools<\/a>: Instructions, templates, and functions for making a basic compendium suitable for writing a reproducible journal article or report with R.<\/li>\n<li><a href=\"https:\/\/jupyter.org\/\">Jupyter Notebooks<\/a>: Web-based interactive computational environment for creating notebook documents. Can be used for supplementary material with journal articles.<\/li>\n<li><a href=\"https:\/\/mybinder.org\/\">Binder<\/a>: Make a repository with Jupyter notebooks available in an executable environment.<\/li>\n<li><a href=\"http:\/\/inundata.org\/talks\/rstd19\/#\/\">\u201cResearch compendia\u201d<\/a>: A set of good practices for reproducible data analysis in R, but much is transferable to other languages.<\/li>\n<\/ul>\n<\/li>\n<li>Do you want to practice your reproducibility skills and get inspired by working with other people\u2019s code\/data? Join a\u00a0<a href=\"https:\/\/github.com\/reprohack\/reprohack-hq\">ReproHack event<\/a>!<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><strong>K\u00e4lla:<\/strong> <a href=\"https:\/\/coderefinery.github.io\/reproducible-research\/02-organizing-projects\/\">Organizing your projects<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Directory structure for projects A good starting point is to keep all files associated with a project in a\u00a0single folder Different projects\u00a0should have\u00a0separate folders Use\u00a0consistent and informative directory structure If you need to separate public\/private\/secret, separate these by folder (and Git repo) Add a\u00a0README file\u00a0to describe the project and instructions on reproducing the results Talk [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"single.php","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-866","post","type-post","status-publish","format-standard","hentry","category-news"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/posts\/866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/comments?post=866"}],"version-history":[{"count":2,"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/posts\/866\/revisions"}],"predecessor-version":[{"id":868,"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/posts\/866\/revisions\/868"}],"wp:attachment":[{"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/media?parent=866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/categories?post=866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yellotab.se\/x056\/wp-json\/wp\/v2\/tags?post=866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}