Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
3

Use Eppy to remove specified parameter

asked 2020-01-14 00:46:08 -0600

katsuya.obara's avatar

I want to delete highlighted default parameter in Daylighting:Controls which cause severe error when I run simulation using eppy.
I tried to input "" but still get same error as shown below.
Does anyone know how I can remove specified parameter in object by eppy?

image description

error

Program Version,EnergyPlus, Version 8.9.0-eba93e8e1b, YMD=2020.01.14 14:33, * Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][1] - Missing required property 'daylighting_reference_point_name'.
* Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][2] - Missing required property 'daylighting_reference_point_name'.
* Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][3] - Missing required property 'daylighting_reference_point_name'.
* Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][4] - Missing required property 'daylighting_reference_point_name'.
* Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][5] - Missing required property 'daylighting_reference_point_name'.
* Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][6] - Missing required property 'daylighting_reference_point_name'.
* Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][7] - Missing required property 'daylighting_reference_point_name'.
* Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][8] - Missing required property 'daylighting_reference_point_name'.
* Severe * <root>[Daylighting:Controls][1F_lecture_classroom][control_data][9] - Missing required property 'daylighting_reference_point_name'.
* Fatal * Errors occurred on processing input file. Preceding condition(s) cause termination.
...Summary of Errors that led to program termination: ..... Reference severe error count=9
..... Last severe error=<root>[Daylighting:Controls][1F_lecture_classroom][control_data][9] - Missing required property 'daylighting_reference_point_name'.
*** Warning: Node connection errors not checked - most system input has not been read (see previous warning). *** Fatal error -- final processing. Program exited before simulations began. See previous error messages.
*** EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors. *** EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors. *** EnergyPlus Terminated--Fatal Error Detected. 0 Warning; 9 Severe Errors; Elapsed Time=00hr 00min 0.37sec

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2020-01-18 02:18:44 -0600

santoshphilip's avatar

updated 2020-01-18 14:12:38 -0600

JasonGlazer's answer is correct

This is a response to katsuya.obara's comment on ( Jan 14 '0 ) to JasonGlazer's answer

Thank you for your answer. So your answer is eppy does not have API to delete fields?

Response: eppy does not have that API. But you can get it from witheppy

To generalize, you are looking for functionality to edit extensible fields in EnergyPlus. Essentially you want functionality that treats an extensible field like a list, where you can append, insert, remove elements in the list

The package witheppy has this functionality. Take a look at extensiblefields2list and list2extensiblefields. If the documentation is not clear, open an issue in here

here is an illustration of how this can work:

# install witheppy by doing:
# pip intall witheppy
# witheppy will also install eppy
import witheppy
import eppy
import witheppy.eppyhelpers.extfields as extfields

# assme you have opened idf file
idf = IDF(idffilename)
# get the first "Daylighting:Controls"
daycs = idf.idfobjects["Daylighting:Controls"]
dayc1 = daycs[0]
print(dayc1)

    DAYLIGHTING:CONTROLS,
        ,                         !- Name
        ,                         !- Zone Name
        SplitFlux,                !- Daylighting Method
        ,                         !- Availability Schedule Name
        Continuous,               !- Lighting Control Type
        0.3,                      !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control
        0.2,                      !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control
        1,                        !- Number of Stepped Control Steps
        1,                        !- Probability Lighting will be Reset When Needed in Manual Stepped Control
        ,                         !- Glare Calculation Daylighting Reference Point Name
        0,                        !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone yAxis
        22,                       !- Maximum Allowable Discomfort Glare Index
        ,                         !- DElight Gridding Resolution
        Ref point 1,              !- Daylighting Reference Point 1 Name
        0.5,                      !- Fraction of Zone Controlled by Reference Point 1
        500,                      !- Illuminance Setpoint at Reference Point 1
        Ref point 2,              !- Daylighting Reference Point 2 Name
        0.5,                      !- Fraction of Zone Controlled by Reference Point 2
        500;                      !- Illuminance Setpoint at Reference Point 2


# extract the reference points as a list (You are extracting the extensible fields in a nested format)
extlist = extfields.extensiblefields2list(dayc1, nested=True)
print(extlist)

    [('Ref point 1', 0.5, 500.0), ('Ref point 2', 0.5, 500.0)]

# Remove the first Reference Point from the list
extlist.pop(0)
print(extlist)

    [('Ref point 2', 0.5, 500.0)]

# put the updated list back into the idfobject
extfields.list2extensiblefields(dayc1, extlist)
print(dayc1)

    DAYLIGHTING:CONTROLS,
        ,                         !- Name
        ,                         !- Zone Name
        SplitFlux,                !- Daylighting Method
        ,                         !- Availability Schedule Name
        Continuous,               !- Lighting Control Type
        0.3,                      !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control
        0.2,                      !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control
        1,                        !- Number of Stepped Control Steps
        1,                        !- Probability Lighting will be Reset When Needed in Manual Stepped Control
        ,                         !- Glare Calculation Daylighting Reference Point Name
        0,                        !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone yAxis
        22,                       !- Maximum Allowable Discomfort Glare Index
        ,                         !- DElight Gridding Resolution
        Ref point 2,              !- Daylighting Reference Point 1 Name
        0.5,                      !- Fraction of Zone Controlled by Reference Point 1
        500;                      !- Illuminance Setpoint at Reference Point 1

# note how the idfobject has changed

Note: See Readme for witheppy to see why this functionality is ... (more)

edit flag offensive delete link more

Comments

Great information!

JasonGlazer's avatar JasonGlazer  ( 2020-01-21 08:04:12 -0600 )edit

Jason, It is useful function. But the API is rather cumbersome at this point.

We have a two step process using this API:

  1. from the idf object extract the extended fields as a list
  2. push the modified list back into the idf object.

A better API would be:

  • Extract extended fields as a list-like structure.
  • Any modification to the list-like structure will immediately change the fields in the idf object.
  • No need to push the list back into the idf object

Well ... one step at a time :-)

santoshphilip's avatar santoshphilip  ( 2020-01-21 12:22:04 -0600 )edit

Maybe even with the "extract" step and just a second representation of extensible fields directly.

As far as the original question if you are considering API enhancements, how about a trim() function that just removes trailing fields that are set to blank or trim(x) that removes fields after field x.

JasonGlazer's avatar JasonGlazer  ( 2020-01-21 12:34:09 -0600 )edit

I wonder how the following step is performed: Extract extended fields as a list-like structure didn't find a resource yet for reading on that, any recommendations would be highly appreciated. Thanks

Aly ElHefny's avatar Aly ElHefny  ( 2020-06-13 12:45:57 -0600 )edit

Aly, I don't have clarity on your question. Can you open an issue at gihub so that I can understand through a discussion. I'll post the conclusions back here.

santoshphilip's avatar santoshphilip  ( 2020-06-13 15:20:38 -0600 )edit
3

answered 2020-01-14 10:14:28 -0600

First off, EnergyPlus requires the first 16 fields (see the \min-fields in the energy+.idd file) of Daylighting:Controls which includes the the fields "Daylighting Reference Point 1 Name", "Fraction of Zone Controlled by Reference Point 1" and "Illuminance Setpoint at Reference Point 1". It doesn't make sense to have Daylighting:Controls without at least one reference point.

Setting fields in eppy to "" is not the same as deleting them. It has been a while since I needed to do that but I think you might want to create a new Daylighting:Controls object and just copy the fields that you want to the new object and then delete the old object.

edit flag offensive delete link more

Comments

Thank you for your answer. So your answer is eppy does not have API to delete fields?

katsuya.obara's avatar katsuya.obara  ( 2020-01-15 01:35:12 -0600 )edit

There probably is a way but I don't know it.

JasonGlazer's avatar JasonGlazer  ( 2020-01-15 06:51:41 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2020-01-14 00:46:08 -0600

Seen: 508 times

Last updated: Jan 18 '20