lemonadelabs / django-merlin

The web backend for Merlin, written on the Django web framework.
1 stars 0 forks source link

better names for input and output #18

Open achimgaedke opened 8 years ago

achimgaedke commented 8 years ago

I've spent some effort on making the process input and output names more readable.

Sadly it looks like they are not exposed to the front-end via the django serializer.

I specify something like:

        # Define Inputs
        self.add_input('Staff Budget', 'staff$')
        self.add_input('Workplaces Available', 'workspace#')

        # Define Outputs
        self.add_output('Overhead work hrs', 'OH_work_hr')
        self.add_output('Line staff work hrs', 'LS_work_hr')
        self.add_output('Budgetary Surplus', 'surplus$')
        self.add_output('Staff Expenses', 'staffExpense$')

in examples.DIAServicesModel.StaffProcess but sadly only the last parameter (unit_type) makes it to the frontend (as I gleaned from http://pingu.:8000/api/entities/9/ ).

I think it would be nice to have the first parameter at the frontend.

Or4c commented 8 years ago

Currently working on this....

Or4c commented 8 years ago

Hi Will. I have added the process inputs and process output names to the description fields of the InputConnector and OutputConnector objects. It would be cool if the node editor used the description fields for the label names instead of the unit_type that they are currently using.

Below is an example of an OutputConnector. Note that now the description field has the new 'human readable' label name of the output.

{
    "id": 1,
    "description": "Budgetary Surplus",
    "name": "surplus$_output",
    "parent": "http://localhost:8000/api/entities/1/",
    "unit_type": "surplus$",
    "apportion_rule": 2,
    "endpoints": [
        {
            "id": 1,
            "description": "",
            "name": "",
            "bias": 1.0,
            "input": null,
            "parent": 1,
            "sim_output": 2
        }
    ]
}
will-sklenars commented 8 years ago

Cool, I have made a front end issue here https://github.com/lemonadelabs/merlin-front-end/issues/86

will-sklenars commented 8 years ago

Front end issue is solved and closed here https://github.com/lemonadelabs/merlin-front-end/pull/87