Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/vdyp 305 #47

Merged
merged 36 commits into from
Jul 23, 2024
Merged

Feature/vdyp 305 #47

merged 36 commits into from
Jul 23, 2024

Conversation

smithkm
Copy link
Collaborator

@smithkm smithkm commented Jun 1, 2024

No description provided.

smithkm added 26 commits May 27, 2024 13:38
…wer if the solver couldn't find an exact one

var resultPerSpecies = new HashMap<String, Float>();

for (float x = -3.9f; x <= 2; x += 0.01) {

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High test

Implicit cast of source type double to narrower destination type float.
@smithkm smithkm force-pushed the feature/VDYP-305 branch from 243e705 to 851bae9 Compare July 17, 2024 04:40
@smithkm smithkm marked this pull request as ready for review July 18, 2024 20:02
Copy link

@smithkm smithkm mentioned this pull request Jul 18, 2024
@@ -82,6 +96,17 @@ public abstract class VdypStartApplication<P extends BaseVdypPolygon<L, Optional
map.put("Y", 9);
});

// TODO Should probably handle this with enums instead for clarity.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added ca.bc.gov.nrs.vdyp.model.DebugSettings class in common and implemented ca.bc.gov.nrs.vdyp.forward.model.ForwardDebugSettings that might prove to be a better way to implement this.

@@ -729,6 +792,16 @@ public float estimatePercentForestLand(P polygon, Optional<L> vetLayer, L primar
protected static final ValueOrMarker.Builder<Float, Boolean> FLOAT_OR_BOOL = ValueOrMarker
.builder(Float.class, Boolean.class);

public static final int UTIL_ALL = UtilizationClass.ALL.index;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we're duplicating these constants (this plus next three) all over the place - maybe put them in UtilizationClass?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That or maybe switching to using the enum directly instead of the index. Maybe a UtilizationVector class instead of or subclassing Coefficients.

layer.getWholeStemVolumeByUtilization().setCoe(UTIL_SMALL, volumeSum);
}

// EMP085
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should note that this can be called only once the ALL lh and qmd values are set for the species. A similar comment applies to each of the following methods.

float logit = //
a0 + //
a1 * coast + //
a2 * layer.getBreastHeightAge().orElse(0f) + //
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the check for breast height age being present? The original FORTRAN code doesn't do this, at least explicitly.

);
}

public void computeUtilizationComponentsPrimary(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment indicating FORTRAN routine - YUC1?

/**
* Apply compatibility variables to all but volume
*/
NO_VOLUME, // 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALL_BUT_VOLUME?

@mjunkin mjunkin merged commit dc7add0 into main Jul 23, 2024
5 checks passed
vividroyjeong added a commit that referenced this pull request Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants