comet-planner
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

comet-planner Documentation

Introduction

comet-planner is a library that consolidates the work of comet-planner.com into a library. This library is based on the work of comet-planner.com. Visit their website for more information.

Features

The Comet Planner library provides access to datasets supplied in different JSON files, with each file containing data for a specific state. The library allows users to retrieve the specific file needed and filter out information based on parameters such as county, class, and practice implementation.

Features

  • State-specific Datasets: Data for each state is stored in separate JSON files, making it easy to access and manage state-specific information.
  • Flexible Filtering: Users can filter the dataset based on various parameters such as county, class, and practice implementation to retrieve relevant information.
  • Easy Integration: The library can be easily integrated into existing projects, enabling developers to leverage state-specific data for analysis and decision-making.

Installation

You can install the library via npm or yarn:

yarn add comet-planner

Usage

// Example usage
import { CometPlanner, SearchCriteria } from 'comet-planner';

const planner = new CometPlanner();

// Retrieve data for a specific state
const result = await planner.getCometRecords(State.Alabama, "Autauga", Implementation.CroplandManagement);

let _searchCriteria: SearchCriteria = {
            isIrrigated: true,
            isNoTill: false,
            isLegumeCover: true,
            isGrassCover: false,
            isForageCrop: false,
            isBiomassCrop: false
        };

const _plannerImplementation = planner.getPlannerImplementation("Cover Crop (CPS 340)", _searchCriteria);
if (_plannerImplementation !== undefined) {
    const _cometRecords = await planner.getCometRecordByImplementation(State.Alabama, "Autauga", _plannerImplementation);
}

Dataset

The library utilizes The Comet Planner dataset. The following represents a brief analysis of the data.

Total Records per State

Total Counties per State

Testing the library

 yarn test                                                                                                                                                            07.05.24    18:02:49  
yarn run v1.22.17
$ jest
 PASS  tests/index.test.ts (14.031 s)
  getCometRecords for AL
    ✓ should return an array of JSON objects for state, county, and class (696 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (615 ms)
  getCometRecords for AR
    ✓ should return an array of JSON objects for state, county, and class (726 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (575 ms)
  getCometRecords for AZ
    ✓ should return an array of JSON objects for state, county, and class (486 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (402 ms)
  getCometRecords for CA
    ✓ should return an array of JSON objects for state, county, and class (921 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (509 ms)
  getCometRecords for CO
    ✓ should return an array of JSON objects for state, county, and class (668 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (589 ms)
  getCometRecords for CT
    ✓ should return an array of JSON objects for state, county, and class (643 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (441 ms)
  getCometRecords for DC
    ✓ should return an array of JSON objects for state, county, and class (437 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (302 ms)
  getCometRecords for FL
    ✓ should return an array of JSON objects for state, county, and class (672 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (731 ms)
  getCometRecords for GA
    ✓ should return an array of JSON objects for state, county, and class (857 ms)
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (709 ms)
  Non Existent State
    ✓ should return an empty array of JSON objects for non existent state, county, and class  (376 ms)
  getPlannerImplementation
    ✓ it should return a planner_implementation (1 ms)
  getCometRecordsByImplementation = Improved Farm Equipment Fuel Efficiency
    ✓ should return an array of JSON objects for state, county, and class (578 ms)
    ✓ should return an empty array of JSON objects for non existent implementation  (631 ms)
  getCometRecordsByImplementation [combined with getPlannerImplementation]
    ✓ it should return a planner_implementation and retrieve the right set of coefficients (593 ms)

Test Suites: 1 passed, 1 total
Tests:       23 passed, 23 total
Snapshots:   0 total
Time:        14.06 s, estimated 15 s
Ran all test suites.
✨  Done in 14.82s.

Readme

Keywords

Package Sidebar

Install

npm i comet-planner

Weekly Downloads

39

Version

0.0.5

License

MIT

Unpacked Size

77 kB

Total Files

14

Last publish

Collaborators

  • serviopalacios