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: Tweaks to allow new SoilTest/NBalanceSummary to be used on the webapp #47

Merged
merged 10 commits into from
Jun 5, 2024

Conversation

Nibble-Byte
Copy link
Contributor

@Nibble-Byte Nibble-Byte commented Jun 1, 2024

@HamishBrownPFR Mostly cosmetic changes on this one. Please let me know if you would like to have a chat.

I would also advise we don't merge this one until you are happy with the webapp.

@HamishBrownPFR HamishBrownPFR marked this pull request as ready for review June 2, 2024 08:13
@@ -14,7 +12,7 @@ public static class Constants
public const double InitialN = 50;

/// <summary>Dictionary containing values for the proportion of maximum DM that occurs at each predefined crop stage</summary>
public static readonly Dictionary<string, double> PropnMaxDM = new()
public static readonly Dictionary<string, double> PropNMaxDM = new()
Copy link
Collaborator

@HamishBrownPFR HamishBrownPFR Jun 2, 2024

Choose a reason for hiding this comment

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

Not major but this change is not really correct. the lower case n was part of a shortening of proportion. Changing it to upper case infers nitrogen which is not correct for this variable. Would be better to remove the n completely

/// <summary>Dictionary containing values for the proportion of thermal time to maturity that has accumulate at each predefined crop stage</summary>
public static readonly Dictionary<string, double> PropnTt = new()
/// <summary>Dictionary containing values for the proportion of thermal time to maturity that has accumulated at each predefined crop stage</summary>
public static readonly Dictionary<string, double> PropNTt = new()
Copy link
Collaborator

@HamishBrownPFR HamishBrownPFR Jun 2, 2024

Choose a reason for hiding this comment

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

Same with this one, delete the N

double soilDepthFactor = SampleDepthFactor[DepthOfSample];
double result = TestValue / soilMF * BulkDensity * 3 * soilDepthFactor;
return new Dictionary<DateTime, double>() { { TestDate, result } };
if (TypeOfTest == TestType.QuickTest.ToString())
Copy link
Collaborator

Choose a reason for hiding this comment

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

could just replace TestType.QuickTest.ToString() with "QuickTest". The longer winded way is a hangover from when I was using enums

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I am fine with leaving it like this for now.
Using enums is certainly cleaner in the long run, but it will require some refactoring on the webapp backend to accommodate.

public double CropIn { get; }
public double ResidueIn { get; }
public double SOMIn { get; }
public double FertiliserIn { get; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't these properties need to have setters on them as well so they can be set by the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The setters are only required if you intend to set values outside of the constructor.
Initially this class had no getters or setters, so the webapp was not able to actually get the values.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't know that but it makes sense when you think about it.

Copy link
Collaborator

@HamishBrownPFR HamishBrownPFR left a comment

Choose a reason for hiding this comment

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

A few things to check @Nibble-Byte, mostly minor.
I will pull your branch and check the everything still works OK in the excel testing system

Copy link
Collaborator

@HamishBrownPFR HamishBrownPFR left a comment

Choose a reason for hiding this comment

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

Code changes all good and local testing of the excel interface is working fine.

@HamishBrownPFR HamishBrownPFR merged commit b72b1d1 into Plant-Food-Research-Open:main Jun 5, 2024
2 checks passed
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