Clo-met value adjustments on Psychro Chart

Hi @mostapha, and @chriswmackey,

I was trying to add an option to insert clo-met values to modify the comfort polygon on the chart but it seems it doesnt work for me in addition to PMVParameter object. any thoughts?

this is how I tried to modify the inputs:

epw_file = 'sample.epw'
global_epw = EPW(epw_file)

def get_fields() -> dict:
    # A dictionary of EPW variable name to its corresponding field number
    return {EPWFields._fields[i]['name'].name: i for i in range(6, 34)}
fields = get_fields()

lb_lp = LegendParameters(colors=Colorset.original())
lb_psy = PsychrometricChart(global_epw.dry_bulb_temperature,
                                global_epw.relative_humidity, legend_parameters=lb_lp)

pmv_param = ladybug_comfort.parameter.pmv.PMVParameter(20,humid_ratio_upper = 0.1, humid_ratio_lower=0.005)
pmv = PolygonPMV(lb_psy,met_rate=[1],clo_value=[0.5],comfort_parameter = pmv_param )

figure = lb_psy.plot(data=global_epw.import_data_by_field(fields['Dry Bulb Temperature']), polygon_pmv=pmv,title='PSYCHROMETRIC CHART', show_title=True)



Hi @amirtabadkani - Can you share a little bit more information on what doesn’t work? A screenshot of what you see versus what you expect to see will be helpful.

@devang might also be able to help with this case.

Hey @amirtabadkani ,

Your ladybug_comfort code looks correct and those values would influence the PMV polygon if you were plotting it in Grasshopper. It’s possible that this is an issue in the ladybug-charts package or perhaps it’s a caching issue with streamlit.

We would know for sure if the pmv.comfort_polygons are changing as you change the PMV inputs but the figure is unchanged.

It does not adjust the PMV polygon when changes are applied.

Thanks, I am using Jupyter Notebook, not the Streamlit atm, so caching issue shouldn’t be the case. True, it changes when we plot in GH, but this is the output of the above code which obviously shouldn’t be correct since it doesn’t follow the min/max humidity ratios and any other changes to the inputs won’t impact the PMV Polygon.

Thanks, @amirtabadkani .

That pretty definitively confirms that it’s a bug in ladybug-charts, then. @mostapha , what do you think is the best way to get this fixed? I know that I could eventually figure it out but it’s going to be a while before my plate gets clear enough for this.

@dev , do you think you might be able to push a fix for this at some point when you get the chance?

I’ll double-check the source code and report back.

Hey @mostapha, I know you are busy with hundreds of questions/reviews :smiley: please let me know if you had time to update the back-end codes on this query. Thanks

Hey @devang, can you please advise on this? thanks

I finally had a chance to take a look and it looks like the issue should be happening here:

We create a new dummy PolygonPMV and don’t use the PolygonPMV that is passed to the function here:

If I understand correctly, this resets all the PolygonPMV to the default settings and ignores the default values. If I replace the line and use the input polygon, the numbers are adjusted but the comfort line goes away.

@devang, can you help me to better understand the logic here? I also see that you create a psych_dummy chart instead of using the input psych that is also a PsychrometricChart and I’m not sure why.

Hi Mostapha,

Is this resolved in the back-end or not yet?


Hi Amir! Unfortunately, this is still a bug. Unless @devang can suggest a quick fix, it will take me some time before I find the time to block half a day to debug this issue.


Sincere apologies for not looking into this. I can see that this has been open for more than half a year. The fact is, I have not done much Pollination related development in the last year at work (Because Pollination just works!) and therefore mostly did not look at the forum.

@amirtabadkani, I have opened a PR to fix this here. I will post here again when it is merged.

1 Like

Hi @amirtabadkani,

This should be fixed in ladybug-charts version 1.19.1

1 Like

Thanks @devang for your help :slight_smile:

2 posts were split to a new topic: Psychro chart unit issue