HydrologicEngineeringCenter / HEC-FDA

Hydrologic Engineering Center - Flood Damage Analysis
MIT License
11 stars 2 forks source link

Direct dollar damage functions #363

Closed rnugent3 closed 2 years ago

rnugent3 commented 2 years ago

if "uses direct dollar == true" then we should ignore the function. import the occupancy type but let the damage function be all zeros.

rnugent3 commented 2 years ago

@codymccoy please prioritize this. I think this should be part of Task 9, too.

codymccoy commented 2 years ago

image I added a check to see if it uses dollar.

image My breakpoint showed that using all bear creek mix has an occtype called 3001 that uses dollar.

image It now assigns all the asset categories to be (0,0) for that occtype.

I believe this is now completed.

rnugent3 commented 2 years ago

greenbrookOccTypes.txt please test using this data

codymccoy commented 2 years ago

@rnugent3 Can you verify that this is fixed? This logic has been merged into main.

rnugent3 commented 2 years ago

I will test.

Best,

R Nugent III

On Jun 3, 2022, at 1:48 PM, codymccoy @.***> wrote:

 @rnugent3 Can you verify that this is fixed? This logic has been merged into main.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

rnugent3 commented 2 years ago

I attempted to import using the file I attached above. I had previously imported bear creek occ types. It looks like there are two occupancy types with the same name. I ran into an unhandled exception.

image

rnugent3 commented 2 years ago

Importing occ types with direct damage functions appear to work as we discussed. We could close this issue now and open a new one to handle the above referenced unhandled exception or keep this issue open for the exception. up to you, @codymccoy

codymccoy commented 2 years ago

Lets just keep this one open

rnugent3 commented 2 years ago

cool, thanks

codymccoy commented 2 years ago

@rnugent3 I just tried to reproduce this bug and could not. This is actually in Bob's code. It looks like he is using a dictionary with a key value pair. If you can reproduce this bug, hover over the occtype name and see what it is. It sounds like greenbrook must have two occtypes with the same name? How do you want this handled, just ignore any occtypes with a duplicate name? We write out a log when they import, so maybe we could write a message out to the log that the user is seeing.

rnugent3 commented 2 years ago

The name is aOccType.Name = "PRB_SA1_SA2_SA3"

rnugent3 commented 2 years ago

The bug mentioned above no longer occurs.