Skip to content

Move engine related code from React to Python #434

@ethanstrominger

Description

@ethanstrominger

To run the python script demonstrating parsing, navigate to python/src and run python -m rules_engine.calculate.

  • Reviewed code to understand. Now we kind of understand
  • write test
  • Before the next line, define csv_string to be the text of the bill file and form_data_string to be the data from the form as a JSON or string (need to decide which one).
  • Look at how form data is cast to Python from Javascript
  • Change str_version in this line to csv_string, form_data_string:

When we run the app, we get ImportError: cannot import name 'calculate' from 'rules_engine'. Use codespace next time.

const pyodideResultsFromTextFilePyProxy: PyProxy = executeCalculation(str_version)
  • Replace lines 150-179. Replace str_version.
    • return data needed for:
      data: str_version,
      convertedDatesTIWD, // this
      county_id, // and the other thing
      // Return case information for linking to case details
      caseInfo: {
      caseId: caseRecord?.id,
      analysisId: analysis?.id,
      heatingInputId: heatingInput?.id
      }
    • use formData.state (not right name) to replace state_id

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions