Skip to content

feat: add parallel axes expansion to the Web API #1327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

bonjourmauko
Copy link
Member

Fixes #1326

New features

  • Introduce parallel axes expansion to the Web API
    • Allows for calculating variables based on a range of depending values

Example

Running the following axes expansion, to calculate disposable_income based on a range of salary:

curl -X POST "http://localhost:5000/calculate" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{\"persons\":{\"Thomas\":{},\"Mauko\":{}},\"households\":{\"workshop\":{\"adults\":[\"Thomas\",\"Mauko\"],\"disposable_income\":{\"2025-03\":null}}},\"axes\":[[{\"count\":11,\"name\":\"salary\",\"min\":0,\"max\":10000,\"period\":\"2025-03\"}]]}" | jq

Gives as a result:

{
  "axes": [
    [
      {
        "count": 11,
        "max": 10000,
        "min": 0,
        "name": "salary",
        "period": "2025-03"
      }
    ]
  ],
  "households": {
    "workshop0": {
      "disposable_income": {
        "2025-03": 1183.3334
      }
    },
    "workshop1": {
      "disposable_income": {
        "2025-03": 2013.3334
      }
    },
    "workshop10": {
      "disposable_income": {
        "2025-03": 9323.333
      }
    },
    "workshop2": {
      "disposable_income": {
        "2025-03": 2843.3333
      }
    },
    "workshop3": {
      "disposable_income": {
        "2025-03": 3673.3333
      }
    },
    "workshop4": {
      "disposable_income": {
        "2025-03": 4503.3335
      }
    },
    "workshop5": {
      "disposable_income": {
        "2025-03": 5333.3335
      }
    },
    "workshop6": {
      "disposable_income": {
        "2025-03": 6163.3335
      }
    },
    "workshop7": {
      "disposable_income": {
        "2025-03": 6953.3335
      }
    },
    "workshop8": {
      "disposable_income": {
        "2025-03": 7743.3335
      }
    },
    "workshop9": {
      "disposable_income": {
        "2025-03": 8533.333
      }
    }
  },
  "persons": {
    "Mauko": {},
    "Thomas": {}
  }
}

@bonjourmauko bonjourmauko added the kind:feat A feature request, a feature deprecation label Mar 17, 2025
@bonjourmauko bonjourmauko requested review from benjello, guillett and a team March 17, 2025 23:25
@bonjourmauko bonjourmauko self-assigned this Mar 17, 2025
@bonjourmauko bonjourmauko changed the title feat: add parallel axes expantion to the Web API feat: add parallel axes expansion to the Web API Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feat A feature request, a feature deprecation
Projects
Development

Successfully merging this pull request may close these issues.

Add axes expansion to the Web API for n-parallel axes
1 participant