Code Monkey home page Code Monkey logo

openfisca-doc's Introduction

OpenFisca Doc

OpenFisca is versatile and free micro-simulation software. This repository contains the source code of its online documentation.

Installation

This documentation is built with Sphinx, a Python documentation generator. You will thus need to install a Python runtime to build it. The version to install is specified in the runtime.txt file.

In order to avoid conflicting dependencies with other projects on your local machine, it is recommended to install its dependencies in a virtual environment. To create a virtual environment, run:

python3 -m venv .venv
source .venv/bin/activate

To install dependencies, run:

make install

Build

To build the HTML documentation, run:

make html

The HTML output will be generated in the build/html directory.

Dev

To serve the documentation in dev mode, run:

make dev

The documentation will be served on http://127.0.0.1:8000

Test

To test the documentation, run:

make test

This will also lint the source files using Markdownlint, for which you will need Node and NPM.

Autoformat

If make lint gives you errors, you can try running the following command to automatically format your contributions according to the existing conventions:

make format

Fixing the doc

If the tests fail, here's what you can do:

If the errors also concern OpenFisca-Core, please take a look at the README.

If not, clone & install the documentation:

git clone https://github.com/openfisca/openfisca-doc
make install

Create a branch to correct the problems:

git checkout -b fix-doc

Fix the offending problems. You can test-drive your fixes by checking that each change works as expected:

make test

Commit at each step, so you don't accidentally lose your progress:

git add -A && git commit -m "Fixed missing doctree"

Once you're done, push your changes:

git push origin `git branch --show-current`

Finally, open a pull request.

That's it! 🙌

Using icons

You can use icons by choosing one from Lucide and adapting the code <i icon-name="$ICON_NAME"></i> with the relevant icon name.

Deploy

The documentation is built as a static website on GitHub Actions with Sphinx. The built files are committed and pushed to the doc folder of the GitHub Pages-published branch of the openfisca.org repository.

OpenFisca-Core triggers a deployment on the Doc repository whenever a new Core version is deployed, to ensure that the Python and Web API auto-generated documentations are up to date. This is done with workflow_dispatch using a personal access token of @openfisca-bot. This personal access token has a maximum lifetime of one year, and will thus need to be updated every year.

openfisca-doc's People

Contributors

alexsobledotgov avatar anna-livia avatar bchoho avatar benjello avatar bonjourmauko avatar br3nda avatar cbenz avatar clementbiron avatar fpagnoux avatar gauntlet173 avatar gitbook-bot avatar guenolec avatar guillett avatar haekadi avatar laem avatar lorenzo-stacchio avatar magopian avatar martinez-hugo avatar mattisg avatar maxghenis avatar mermop avatar morendil avatar pachevalier avatar pblayo avatar renardpal avatar robincsl avatar sandcha avatar shabananaik avatar tjharrop avatar verbman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openfisca-doc's Issues

Rename this repo to “doc”

In order to increase readability, rename this repo so that its full name is “openfisca/doc” rather than “openfisca/openfisca-doc”.

Update reforms documentation

Related to openfisca/openfisca-france#705.

  • Document what is a reform.
  • Document the difference between reform and extension.
  • Document how to neutralise a variable.
  • Document how to rewrite the formula of a variable (“réforme structurelle”).
  • Document how to modify a parameter (“réforme paramétrique”).

Deprecate jupyter.openfisca.fr

  • Remove references in the doc.
  • Ensure there is a ready-to-use binder link with the latest openfisca france available in the doc.
  • Warn existing users to save all their data.
  • Create a “sunset” page: static page that explains that the service is not offered anymore, and gives a link to the appropriate replacements in the doc. This page should be served on the root subdomain, while existing direct links may still be served.

Document Python version

  • Add --python=python2 in https://doc.openfisca.fr/for_users.html
  • Document this python version in the user doc.
  • Document this python version in the README of core.
  • Document this python version in the README of france.
  • Document this python version in the README of web-api.
  • Unpublish the france source package that looks like it is compatible with all Python versions (see openfisca/openfisca-core#466).

Source: openfisca/openfisca-core#466


EDIT: Replace --python=python2_7 by --python=python2 — the very required version is 2

Explicit vector computations with pluralized argument name

Currently a formula as the following signature

def formula(person, period, parameters)

What do you think about using people instead of person to reflect the vector computation ?

For instance:

def formula(people, period, parameters)

Problems in presentation.md

Links to réforme, interface web, API web... cannot be accessed.

The english presentatoin is duplicated. Keep the first paragraph only, followed by a shortcut link to the english section ?

Deploy continuously

Since 3 PR now I receive an email from gitbook saying:

We were not able to automatically sync the content of your book openfisca/documentation with the github.com/openfisca/openfisca-gitbook repository.

Go to your book's settings page to resolve this conflict manually.

The solution I found is to create a fake commit like this one.

But this is not scalable.

I do not understand why it happens.

Perhaps it's due to the migration of the gitbook v2 platform. In that case we could delete the book and recreate it, or if it does not work, delete the whole account and recreate it. But that's only a supposition.

Remove French contents

As a French-speaking contributor,
I don't have the opportunity to select the French version of the manual,
So that I am deluded into thinking there is one

Update contributing page to reflect latest contribution learnings and experiments

Pistes de réflexion :

Can FOSS projects benefit from integrating Kanban
Discussion sur le Slack d'Agendashift
Délai de traitement des contributions externes - livre blanc communs

Voici pour moi quelques choses à considérer d’un point de vue « dév » :

  • S’il y a de changements que sont introduits comme dépendances d’autres changements, ils peuvent facilement être mis dans de pull requests différentes, en séquence.
  • S’il y a de changements avec des dépendances croisées, plusieurs stratégies :
  • Créer une PR intermédiaire et faire de petites PR qui n’iront pas sur master mais sur cette PR
  • Essayer de couper ces dépendances (là je n’ai pas d’avis car pas encore regardé la PR au plus près) puis faire de PR petites
  • Introduire un flag : s’il y a de modifs qui n’ont pas de sens sans l’ensemble, on ajoute les changements et on garde les deux sur une même règle existante, puis on définit un flag, sort de switch, qui dit « pour l’instant, en prod, prend la définition actuelle, et dans les tests, prend les deux ».
  • L’unité atomique par excellence d’une PR est le test, donc on pourrait aller même à faire une PR par test, si cela a du sens
  • En termes de priorité, c’est mieux traiter les modifications de l’existant avant que les ajouts. Si pour un test en particulier il y a les deux, cela peux aller comme ça : séparer les modifs et les ajouts, et merger avant les ajouts.

On peut, bien évidement, aider à faire quelques pull request d’exemple afin de montrer en concret tout cela, mais il faut qu’on ait une idée de l’interdépendance du saucisson.

Aussi, cela pourrait être intéressant d'envisager une façon d'étendre le circle de contributeurs qui peuvent accepter, voir merger, une pull-request.

Puis, peut-être donner aussi de tips pour faire de rebase du code avant merger.

Et, finalement, de faire un triage par simple, moyen et compliqué des bugs ou de demandes d'amélioration.

Cela dit, ça serait pas mal d’ajouter une liste de tips comme ça quelque part (CONTRIBUTING ou ailleurs).

Move Web API documentation to Web API repository

I think the technical documentation about the Web API should not be part of the gitbook documentation.
This would reduce the scope of the gitbook doc to a user guide, not a technical documentation.

Given we launched the reference documentation of the Core recently, we can either:

Any thoughts?

Unify reforms and extensions information hierarchy

Reforms are currently presented as part of the “key concepts” while extensions are part of the “contribute” part, and do not link back to reforms.

  • Make extensions a part of the “key
    concepts”.
  • Make reforms a specific instance of extensions (or the other way around?).
  • Make it clear for the user in which case she should use which mechanism.

Update Web-API reforms link

On Extensions page, it should link to https://github.com/openfisca/openfisca-gitbook/blob/master/openfisca-web-api/extensions.md.
@cbenz How do you make this link understandable by gitbook ?

openfisca/tutorial

Change Mes_aides_to_openfisca script to take mes_aides situation ID as input

Consolidate list of reusers

Quand je considère recommander d'OpenFisca,
j'ai besoin de savoir qui sont ses ré-utilisateurs,
pour pouvoir être rassuré·e de bien investir mon capital de réputation.

Migrate to openfisca.org

This documentation is only available in English, and we don't intend to translate it anytime soon. Even if we were to, it would most probably be as subfolders rather than on fully different domains, to minimise discrepancies, as was the case a few months ago when this doc still had a few (outdated) pages in French.

It should thus be hosted on the openfisca.org domain rather than openfisca.fr.

I currently don't see a major reason for having a subdomain for documentation. Having doc.openfisca.fr is an artefact of hosting being provided by readthedocs.io with a DNS record pointing to their servers. I think we are free to use either a subpath or a subdomain.

Missing any technical reason for choosing one over another, I've asked Twitter 😉

  • Update all links in all repos.
  • Add a 301 on doc.openfisca.fr

Normalise code examples

There are some examples in the documentation that are written for the country-template while other are for openfisca-france.

Imagine the terrified face of users when they see this.

It should be improved :

  • Fix variables naming section
  • Update "writing YAML tests"
  • Reword "The system for France is currently the only one well implemented" in key-concepts/tax_and_benefit_system (it's not super friendly)
  • Don't equate two unrelated concepts in key-concepts/variables: "basic income (in France, RSA)"
  • Don't mention Paris specifically, use a generic concept like "postal code" in key-concepts/variables
  • Use the country template entities as examples rather than France, in key-concepts/person,_entities,_role
  • Ditto for roles
  • Improve the section title "Application: module used by OpenFisca" in key-concepts/person,_entities,_role
  • use country template variables in key-concepts/input_data
  • use a country template test case in key-concepts/input_data
  • don't recommend using the "modality" of an enum in key-concepts/input_data
  • use a country template example in key-concepts/simulation

Direct first-time users

As a first-time user already convinced of the use of OpenFisca in my context,
I have a bird's eye view of the software components and how to install them,
So that I understand with which piece I should interact

Add notebooks as examples

As a new user,
I can find interactive usage examples,
So that I can test OpenFisca and understand what it does

Enhance doc based on feedbacks

Kinta et Christian sont venus aujourd'hui pour installer openfisca et commencer à le prendre en main.

L'installation sur Windows a été douloureuse. openfisca lui-même ça a été, il a juste fallu ajouter python puis pip au PATH. C'est sur paster qu'on a buté : la dépendance sur pastescript n'est pas documentée, et le script start.sh sur smgpa/openfisca ne fonctionnait pas. Axel nous a tiré d'affaires mais c'était non trivial.

Je pense que ça pousse une fois de plus pour qu'on investisse dans un vagrant file.

Une fois qu'on a pu commencer à coder, c'était mieux. On a implémenté progressivement une aide imaginaire avec des critères assez simple. Pour le moment le truc sur lequel on a buté c'est les params.xml: quand tu as trouvé ton paramètre, deviner le path c'est pénible.

Autre point, il faut documenter quelque part :

  • Les types de Column disponibles
  • Les raccourcis pour les dates

Pendant que Florian expliquait tout ça à Kinta, j'étais moi aussi en train d'implémenter une aide. Je vous ferai un retour bientôt, mais je peux confirmer ma confusion sur ces deux points : SimpleFormulaColumn vs DatedFormulaColumn, et comment faire des opérations sur les dates (period, contrat_travail_debut, contrat_travail_fin).
Pour les dates, une doc de ce genre aurait beaucoup de valeur.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.