Socket
Socket
Sign inDemoInstall

comet-planner

Package Overview
Dependencies
9
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    comet-planner

A Comet planner library.


Version published
Maintainers
1
Created

Readme

Source

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.

Keywords

FAQs

Last updated on 08 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc