CropGuardian.SoilMetrics 2.0.0

dotnet add package CropGuardian.SoilMetrics --version 2.0.0                
NuGet\Install-Package CropGuardian.SoilMetrics -Version 2.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CropGuardian.SoilMetrics" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CropGuardian.SoilMetrics --version 2.0.0                
#r "nuget: CropGuardian.SoilMetrics, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CropGuardian.SoilMetrics as a Cake Addin
#addin nuget:?package=CropGuardian.SoilMetrics&version=2.0.0

// Install CropGuardian.SoilMetrics as a Cake Tool
#tool nuget:?package=CropGuardian.SoilMetrics&version=2.0.0                

CropGuardian.SoilMetrics v2.0.0 - Release Notes

Overview

Version 2.0.0 introduces significant new features, optimizations, and structural improvements for better flexibility, functionality, and performance. This update enhances soil analysis accuracy, adds support for customizable data providers, and improves soil moisture and nutrient analysis. Below are the key changes.

Major Features and Enhancements:

  1. Customizable Crop Data Providers:

    • Added support for external data providers via the ICropNutrientSufficiencyProvider interface.
    • Developers can now plug in their own crop nutrient sufficiency data or retrieve data dynamically from external databases or APIs.
  2. Detailed Fertilizer Recommendations:

    • The analysis service now provides detailed recommendations for fertilizer application based on the deficiency level.
    • The system calculates and suggests the amount of fertilizer to apply for each nutrient deficiency (e.g., "Apply 1.09 kg/ha of Urea").
  3. Enhanced Soil Moisture Analysis:

    • Soil moisture levels are now incorporated into nutrient recommendations.
    • The system provides recommendations for irrigation or drainage based on real-time soil moisture levels.
  4. Simulated Soil Data Generator:

    • Updated the SimulatedDataService to generate random soil nutrient data based on predefined or purely random ranges.
    • The generated data helps in testing and simulating different soil conditions for multiple crops.
  5. Refined Exception Handling:

    • Introduced robust exception handling to ensure clearer error messages during soil analysis.
    • Added validation logic for both soil and crop data, raising appropriate exceptions if any data is missing or invalid.

API Changes:

  • Renamed Range to NutrientRange:

    • This improves clarity in the data model to represent nutrient sufficiency ranges for different crops.
    • Affects all references to crop nutrient ranges.
  • Refactored AnalyzeSoil Method:

    • The AnalyzeSoil method now accepts ICropNutrientSufficiencyProvider to allow for flexible nutrient sufficiency data retrieval.
    • Improved return types and structured exception handling for missing data.
  • New Helper Functions:

    • CheckAndRecommend: A new utility method for checking nutrient levels and providing fertilizer recommendations.
    • CalculateFertilizerAmount: Computes the specific fertilizer application rate based on the deficiency.

Bug Fixes:

  • Fixed incorrect handling of empty or null crop and soil data by enforcing the use of option types.
  • Resolved type mismatch issues when handling F# lists and .NET lists, ensuring proper collection conversions.
  • Corrected issues with tests failing due to partial string matches in recommendations by introducing substring matching in test assertions.

Performance Improvements:

  • Optimized data flow and nutrient analysis logic for better performance when handling large sets of crop and soil data.
  • Improved random data generation performance for simulations, reducing computation time.

Breaking Changes:

  • API Structure: The introduction of ICropNutrientSufficiencyProvider and related interfaces requires updates to existing implementations.
    • Developers must now provide crop data via this interface or use the new StaticCropProvider.
  • Renaming of Range: If you relied on the Range type in previous versions, you’ll need to update your code to use NutrientRange.

Deprecations:

  • The use of direct nutrient sufficiency data without a provider is deprecated. Developers are encouraged to implement or inject their own crop data providers for better flexibility.

Testing and Quality Improvements:

  • Expanded unit test coverage for all core services, including soil analysis, simulated data generation, and soil moisture recommendations.
  • Improved tests with detailed assertions for fertilizer and moisture recommendations.

These release notes provide a comprehensive overview of the new features, improvements, and breaking changes introduced in version 2.0.0.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 109 9/13/2024
1.0.0 127 9/11/2024