https://github.com/catalalang/catala-examples

Collection of Catala programs

https://github.com/catalalang/catala-examples

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    11 of 33 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.4%) to scientific vocabulary

Keywords from Contributors

legislative-texts programming-language benchmarking syntax-highlighting climate transformation
Last synced: 10 months ago · JSON representation

Repository

Collection of Catala programs

Basic Info
  • Host: GitHub
  • Owner: CatalaLang
  • License: apache-2.0
  • Language: OCaml
  • Default Branch: master
  • Size: 12.4 MB
Statistics
  • Stars: 7
  • Watchers: 6
  • Forks: 4
  • Open Issues: 2
  • Releases: 0
Created over 2 years ago · Last pushed 11 months ago
Metadata Files
Readme License

README.md

Catala examples

This repository contains examples of Catala programs. It is highly recommended to locate your own Catala programs in this directory, since programs in this directory will receive first-class support during the alpha and beta stage of the Catala programming language development.

Browse examples online »

List of examples

  • allocations_familiales/: computation of the French family benefits, based on the Code de la sécurité sociale.
  • aides_logement: computation of the French housing benefits, based on the Code de la construction et de l'habitation. This case study is the biggest and most ambitious for Catala so far.
  • us_tax_code/: contains the Catala formalization of several sections of the US Tax Code.

Building and running examples

Use Clerk (it comes installed alongside catala) to build and test your examples.

Note: For now, the OCaml, Javascript and Python artifacts that are used in https://github.com/CatalaLang/french-law are generated using dune rules instead, while Clerk is getting mature enough. See the examples in aides_logement/dune and allocations_familiales/dune.

Testing examples

Unit testing is important, and we encourage Catala developers to write lots of tests for their programs. Again, the Makefile system provides a way to collect tests into a regression test suite.

In order to enjoy the benefits of this system, we recommand that you create a tests/ directory in your examples directory, for instance foo/tests. Then, create a test file foo_tests.catala_en inside that directory.

Inside foo_tests.catala_en, declare one ore more test scopes. Then, you can provide the expected output for the interpretation of these scopes or the compilation of the whole program using the standard expected by clerk test by including catala-test-cli sections in your file.

Once your tests are written, then will automatically be added to the regression suite executed using:

clerk test

You can isolate a part of the regression suite by invoking:

clerk test foo/tests/foo_tests.catala_en

Adding an example

This section describes what to do to setup a working directory for a new Catala example, as well as the development cycle. Let us suppose that you want to create a new example named foo.

First, follow the instructions to install the Catala compiler. You can also set up the syntax highlighting for your editor.

Then, create the directory examples/foo. In there, create a master source file foo.catala_en (or foo.catala_fr, etc. depending on your language) that will be the root of your Catala program. You can then start programming in foo.catala_en, or split up your example into multiple files. In the later case, foo.catala_en must only contain something like this:

```markdown

Master file

Include: bar.catala_en ```

where examples/bar.catala_en is another source file containing code for your example. Make sure you start by including some content in the source files, like

Hello, world!

Owner

  • Name: CatalaLang
  • Login: CatalaLang
  • Kind: organization

GitHub Events

Total
  • Watch event: 2
  • Issue comment event: 3
  • Push event: 42
  • Pull request review comment event: 3
  • Pull request review event: 6
  • Pull request event: 20
  • Fork event: 1
  • Create event: 15
Last Year
  • Watch event: 2
  • Issue comment event: 3
  • Push event: 42
  • Pull request review comment event: 3
  • Pull request review event: 6
  • Pull request event: 20
  • Fork event: 1
  • Create event: 15

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 785
  • Total Committers: 33
  • Avg Commits per committer: 23.788
  • Development Distribution Score (DDS): 0.39
Past Year
  • Commits: 40
  • Committers: 5
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.525
Top Committers
Name Email Commits
Denis Merigoux d****x@g****m 479
Louis Gesbert l****t@o****m 105
Lilya Slimani l****e@g****m 28
Emile Rolley e****y@t****o 27
Bartosz Woźniak b****0@g****m 21
James Barnes 5****b 20
James Barnes 17
JusBanuls j****s@i****r 16
Hugo Gimbert h****t@c****r 7
lIlIlIlIIIIlIIIllIIlIllIIllIII l****I 7
vbot v****l@i****r 6
armandsalek 8****k 5
Aminata-Dev b****a@g****m 5
Aida Ibrahim a****m@l****r 4
Jonathan Protzenko j****o@g****m 4
Edwin Török e****n@e****t 4
Aymeric Fromherz f****z@c****u 3
adelaett 9****t 3
armandsalek a****d@s****c 3
Alain a****n@i****r 3
Nicolas Chataing n****g@e****r 3
Raphaël Monat r****t@i****r 2
Siggy Scott e****t@m****g 2
PRIMET Romain r****t@i****r 2
Artur Cygan a****n@g****m 1
JusBanuls j****s@i****r 1
armand a****d@d****n 1
XB x****n@p****g 1
Raphaël Monat r****t@l****r 1
Matthew Gerrior g****w@g****m 1
and 3 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 34
  • Average time to close issues: N/A
  • Average time to close pull requests: 6 days
  • Total issue authors: 0
  • Total pull request authors: 6
  • Average comments per issue: 0
  • Average comments per pull request: 0.26
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 23
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Issue authors: 0
  • Pull request authors: 5
  • Average comments per issue: 0
  • Average comments per pull request: 0.26
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • AltGr (1)
Pull Request Authors
  • AltGr (28)
  • denismerigoux (9)
  • vincent-botbol (5)
  • rprimet (3)
  • samestep (2)
  • pierregoutagny (2)
Top Labels
Issue Labels
Pull Request Labels