Skip to content

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 a team, benjello and guillett 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
@bonjourmauko
Copy link
Member Author

Up !

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