Skip to content
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

Remove yearly variable addition #38

Merged
merged 2 commits into from
Jan 3, 2024
Merged

Conversation

anth-volk
Copy link
Collaborator

Fixes #37. This PR removes the function add_yearly_variables and the check inside get_calculate for whether or not a parameter has been declared that would provide these variables.

When posting the below data object:

Click to expand (56 lines)
{
"household": {
  "benunits": {
    "your immediate family": {
      "members": [
        "you",
        "your first child"
      ]
    }
  },
  "households": {
    "your household": {
      "BRMA": {
        "2024": null
      },
      "local_authority": {
        "2024": "MAIDSTONE"
      },
      "members": [
        "you",
        "your first child"
      ],
      "region": {
        "2024": "LONDON"
      }
    }
  },
  "people": {
    "you": {
      "age": {
        "2024": 40
      },
      "employment_income": {
        "2024": null
      }
    },
    "your first child": {
      "age": {
        "2024": 10
      }
    }
  },
  "axes": [
    [
      {
        "name": "employment_income",
        "period": "2024",
        "min": 0,
        "max": 200000,
        "count": 401
      }
    ]
  ]
},
"policy": {}
}

to the /uk/calculate endpoint, I receive the following response:

Click to expand (861 lines)
{
  "message": null, 
  "result": {
    "axes": [
      [
        {
          "count": 401, 
          "max": 200000, 
          "min": 0, 
          "name": "employment_income", 
          "period": "2024"
        }
      ]
    ], 
    "benunits": {
      "your immediate family": {
        "members": [
          "you", 
          "your first child"
        ]
      }
    }, 
    "households": {
      "your household": {
        "BRMA": {
          "2024": [
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0, 
            73.0
          ]
        }, 
        "local_authority": {
          "2024": "MAIDSTONE"
        }, 
        "members": [
          "you", 
          "your first child"
        ], 
        "region": {
          "2024": "LONDON"
        }
      }
    }, 
    "people": {
      "you": {
        "age": {
          "2024": 40
        }, 
        "employment_income": {
          "2024": [
            0.0, 
            500.0, 
            1000.0, 
            1500.0, 
            2000.0, 
            2500.0, 
            3000.0, 
            3500.0, 
            4000.0, 
            4500.0, 
            5000.0, 
            5500.0, 
            6000.0, 
            6500.0, 
            7000.0, 
            7500.0, 
            8000.0, 
            8500.0, 
            9000.0, 
            9500.0, 
            10000.0, 
            10500.0, 
            11000.0, 
            11500.0, 
            12000.0, 
            12500.0, 
            13000.0, 
            13500.0, 
            14000.0, 
            14500.0, 
            15000.0, 
            15500.0, 
            16000.0, 
            16500.0, 
            17000.0, 
            17500.0, 
            18000.0, 
            18500.0, 
            19000.0, 
            19500.0, 
            20000.0, 
            20500.0, 
            21000.0, 
            21500.0, 
            22000.0, 
            22500.0, 
            23000.0, 
            23500.0, 
            24000.0, 
            24500.0, 
            25000.0, 
            25500.0, 
            26000.0, 
            26500.0, 
            27000.0, 
            27500.0, 
            28000.0, 
            28500.0, 
            29000.0, 
            29500.0, 
            30000.0, 
            30500.0, 
            31000.0, 
            31500.0, 
            32000.0, 
            32500.0, 
            33000.0, 
            33500.0, 
            34000.0, 
            34500.0, 
            35000.0, 
            35500.0, 
            36000.0, 
            36500.0, 
            37000.0, 
            37500.0, 
            38000.0, 
            38500.0, 
            39000.0, 
            39500.0, 
            40000.0, 
            40500.0, 
            41000.0, 
            41500.0, 
            42000.0, 
            42500.0, 
            43000.0, 
            43500.0, 
            44000.0, 
            44500.0, 
            45000.0, 
            45500.0, 
            46000.0, 
            46500.0, 
            47000.0, 
            47500.0, 
            48000.0, 
            48500.0, 
            49000.0, 
            49500.0, 
            50000.0, 
            50500.0, 
            51000.0, 
            51500.0, 
            52000.0, 
            52500.0, 
            53000.0, 
            53500.0, 
            54000.0, 
            54500.0, 
            55000.0, 
            55500.0, 
            56000.0, 
            56500.0, 
            57000.0, 
            57500.0, 
            58000.0, 
            58500.0, 
            59000.0, 
            59500.0, 
            60000.0, 
            60500.0, 
            61000.0, 
            61500.0, 
            62000.0, 
            62500.0, 
            63000.0, 
            63500.0, 
            64000.0, 
            64500.0, 
            65000.0, 
            65500.0, 
            66000.0, 
            66500.0, 
            67000.0, 
            67500.0, 
            68000.0, 
            68500.0, 
            69000.0, 
            69500.0, 
            70000.0, 
            70500.0, 
            71000.0, 
            71500.0, 
            72000.0, 
            72500.0, 
            73000.0, 
            73500.0, 
            74000.0, 
            74500.0, 
            75000.0, 
            75500.0, 
            76000.0, 
            76500.0, 
            77000.0, 
            77500.0, 
            78000.0, 
            78500.0, 
            79000.0, 
            79500.0, 
            80000.0, 
            80500.0, 
            81000.0, 
            81500.0, 
            82000.0, 
            82500.0, 
            83000.0, 
            83500.0, 
            84000.0, 
            84500.0, 
            85000.0, 
            85500.0, 
            86000.0, 
            86500.0, 
            87000.0, 
            87500.0, 
            88000.0, 
            88500.0, 
            89000.0, 
            89500.0, 
            90000.0, 
            90500.0, 
            91000.0, 
            91500.0, 
            92000.0, 
            92500.0, 
            93000.0, 
            93500.0, 
            94000.0, 
            94500.0, 
            95000.0, 
            95500.0, 
            96000.0, 
            96500.0, 
            97000.0, 
            97500.0, 
            98000.0, 
            98500.0, 
            99000.0, 
            99500.0, 
            100000.0, 
            100500.0, 
            101000.0, 
            101500.0, 
            102000.0, 
            102500.0, 
            103000.0, 
            103500.0, 
            104000.0, 
            104500.0, 
            105000.0, 
            105500.0, 
            106000.0, 
            106500.0, 
            107000.0, 
            107500.0, 
            108000.0, 
            108500.0, 
            109000.0, 
            109500.0, 
            110000.0, 
            110500.0, 
            111000.0, 
            111500.0, 
            112000.0, 
            112500.0, 
            113000.0, 
            113500.0, 
            114000.0, 
            114500.0, 
            115000.0, 
            115500.0, 
            116000.0, 
            116500.0, 
            117000.0, 
            117500.0, 
            118000.0, 
            118500.0, 
            119000.0, 
            119500.0, 
            120000.0, 
            120500.0, 
            121000.0, 
            121500.0, 
            122000.0, 
            122500.0, 
            123000.0, 
            123500.0, 
            124000.0, 
            124500.0, 
            125000.0, 
            125500.0, 
            126000.0, 
            126500.0, 
            127000.0, 
            127500.0, 
            128000.0, 
            128500.0, 
            129000.0, 
            129500.0, 
            130000.0, 
            130500.0, 
            131000.0, 
            131500.0, 
            132000.0, 
            132500.0, 
            133000.0, 
            133500.0, 
            134000.0, 
            134500.0, 
            135000.0, 
            135500.0, 
            136000.0, 
            136500.0, 
            137000.0, 
            137500.0, 
            138000.0, 
            138500.0, 
            139000.0, 
            139500.0, 
            140000.0, 
            140500.0, 
            141000.0, 
            141500.0, 
            142000.0, 
            142500.0, 
            143000.0, 
            143500.0, 
            144000.0, 
            144500.0, 
            145000.0, 
            145500.0, 
            146000.0, 
            146500.0, 
            147000.0, 
            147500.0, 
            148000.0, 
            148500.0, 
            149000.0, 
            149500.0, 
            150000.0, 
            150500.0, 
            151000.0, 
            151500.0, 
            152000.0, 
            152500.0, 
            153000.0, 
            153500.0, 
            154000.0, 
            154500.0, 
            155000.0, 
            155500.0, 
            156000.0, 
            156500.0, 
            157000.0, 
            157500.0, 
            158000.0, 
            158500.0, 
            159000.0, 
            159500.0, 
            160000.0, 
            160500.0, 
            161000.0, 
            161500.0, 
            162000.0, 
            162500.0, 
            163000.0, 
            163500.0, 
            164000.0, 
            164500.0, 
            165000.0, 
            165500.0, 
            166000.0, 
            166500.0, 
            167000.0, 
            167500.0, 
            168000.0, 
            168500.0, 
            169000.0, 
            169500.0, 
            170000.0, 
            170500.0, 
            171000.0, 
            171500.0, 
            172000.0, 
            172500.0, 
            173000.0, 
            173500.0, 
            174000.0, 
            174500.0, 
            175000.0, 
            175500.0, 
            176000.0, 
            176500.0, 
            177000.0, 
            177500.0, 
            178000.0, 
            178500.0, 
            179000.0, 
            179500.0, 
            180000.0, 
            180500.0, 
            181000.0, 
            181500.0, 
            182000.0, 
            182500.0, 
            183000.0, 
            183500.0, 
            184000.0, 
            184500.0, 
            185000.0, 
            185500.0, 
            186000.0, 
            186500.0, 
            187000.0, 
            187500.0, 
            188000.0, 
            188500.0, 
            189000.0, 
            189500.0, 
            190000.0, 
            190500.0, 
            191000.0, 
            191500.0, 
            192000.0, 
            192500.0, 
            193000.0, 
            193500.0, 
            194000.0, 
            194500.0, 
            195000.0, 
            195500.0, 
            196000.0, 
            196500.0, 
            197000.0, 
            197500.0, 
            198000.0, 
            198500.0, 
            199000.0, 
            199500.0, 
            200000.0
          ]
        }
      }, 
      "your first child": {
        "age": {
          "2024": 10
        }
      }
    }
  }, 
  "status": "ok"
}

This appears to work correctly, but I want to confirm that the output is our intended behavior: the result of the calculation does not provide any other information beyond axes for the variables that were included with the initial household data. For example, in the case of this test example, the output of the calculation doesn't seem to tell the user anything new about their potential annual income.

@nikhilwoodruff nikhilwoodruff merged commit 001b520 into main Jan 3, 2024
3 checks passed
@nikhilwoodruff nikhilwoodruff deleted the fix/remove_unnecessary_funcs branch January 3, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unnecessary add_yearly_variables function and invocation of function inside get_calculate
2 participants