Skip to content

Commit

Permalink
😒 chore: Rename package.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Dec 20, 2021
1 parent 49bee8f commit 3049f7d
Show file tree
Hide file tree
Showing 16 changed files with 1,867 additions and 2,514 deletions.
2 changes: 1 addition & 1 deletion .esdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"autoPrivate": true
},
"brand": {
"title": "@aureooms/js-knapsack"
"title": "@problem-solving/knapsack"
},
"test": {
"type": "ava",
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
:school_satchel: [@aureooms/js-knapsack](https://aureooms.github.io/js-knapsack)
:school_satchel: [@problem-solving/knapsack](https://computational-problem-solving.github.io/knapsack)
==

Knapsack problem algorithms for JavaScript.
See [docs](https://aureooms.github.io/js-knapsack/index.html).
See [docs](https://computational-problem-solving.github.io/knapsack/index.html).

> :building_construction: Caveat emptor! This is work in progress. Code may be
> working. Documentation may be present. Coherence may be. Maybe.
> :warning: The code requires `regeneratorRuntime` to be defined, for instance by importing
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
[![License](https://img.shields.io/github/license/aureooms/js-knapsack.svg)](https://raw.githubusercontent.com/aureooms/js-knapsack/main/LICENSE)
[![Version](https://img.shields.io/npm/v/@aureooms/js-knapsack.svg)](https://www.npmjs.org/package/@aureooms/js-knapsack)
[![Build](https://img.shields.io/travis/aureooms/js-knapsack/main.svg)](https://travis-ci.org/aureooms/js-knapsack/branches)
[![Dependencies](https://img.shields.io/david/aureooms/js-knapsack.svg)](https://david-dm.org/aureooms/js-knapsack)
[![Dev dependencies](https://img.shields.io/david/dev/aureooms/js-knapsack.svg)](https://david-dm.org/aureooms/js-knapsack?type=dev)
[![GitHub issues](https://img.shields.io/github/issues/aureooms/js-knapsack.svg)](https://github.com/aureooms/js-knapsack/issues)
[![Downloads](https://img.shields.io/npm/dm/@aureooms/js-knapsack.svg)](https://www.npmjs.org/package/@aureooms/js-knapsack)
[![License](https://img.shields.io/github/license/computational-problem-solving/knapsack.svg)](https://raw.githubusercontent.com/computational-problem-solving/knapsack/main/LICENSE)
[![Version](https://img.shields.io/npm/v/@problem-solving/knapsack.svg)](https://www.npmjs.org/package/@problem-solving/knapsack)
[![Build](https://img.shields.io/travis/computational-problem-solving/knapsack/main.svg)](https://travis-ci.org/computational-problem-solving/knapsack/branches)
[![Dependencies](https://img.shields.io/david/computational-problem-solving/knapsack.svg)](https://david-dm.org/computational-problem-solving/knapsack)
[![Dev dependencies](https://img.shields.io/david/dev/computational-problem-solving/knapsack.svg)](https://david-dm.org/computational-problem-solving/knapsack?type=dev)
[![GitHub issues](https://img.shields.io/github/issues/computational-problem-solving/knapsack.svg)](https://github.com/computational-problem-solving/knapsack/issues)
[![Downloads](https://img.shields.io/npm/dm/@problem-solving/knapsack.svg)](https://www.npmjs.org/package/@problem-solving/knapsack)

[![Code issues](https://img.shields.io/codeclimate/issues/aureooms/js-knapsack.svg)](https://codeclimate.com/github/aureooms/js-knapsack/issues)
[![Code maintainability](https://img.shields.io/codeclimate/maintainability/aureooms/js-knapsack.svg)](https://codeclimate.com/github/aureooms/js-knapsack/trends/churn)
[![Code coverage (cov)](https://img.shields.io/codecov/c/gh/aureooms/js-knapsack/main.svg)](https://codecov.io/gh/aureooms/js-knapsack)
[![Code technical debt](https://img.shields.io/codeclimate/tech-debt/aureooms/js-knapsack.svg)](https://codeclimate.com/github/aureooms/js-knapsack/trends/technical_debt)
[![Documentation](https://aureooms.github.io/js-knapsack/badge.svg)](https://aureooms.github.io/js-knapsack/source.html)
[![Package size](https://img.shields.io/bundlephobia/minzip/@aureooms/js-knapsack)](https://bundlephobia.com/result?p=@aureooms/js-knapsack)
[![Code issues](https://img.shields.io/codeclimate/issues/computational-problem-solving/knapsack.svg)](https://codeclimate.com/github/computational-problem-solving/knapsack/issues)
[![Code maintainability](https://img.shields.io/codeclimate/maintainability/computational-problem-solving/knapsack.svg)](https://codeclimate.com/github/computational-problem-solving/knapsack/trends/churn)
[![Code coverage (cov)](https://img.shields.io/codecov/c/gh/computational-problem-solving/knapsack/main.svg)](https://codecov.io/gh/computational-problem-solving/knapsack)
[![Code technical debt](https://img.shields.io/codeclimate/tech-debt/computational-problem-solving/knapsack.svg)](https://codeclimate.com/github/computational-problem-solving/knapsack/trends/technical_debt)
[![Documentation](https://computational-problem-solving.github.io/knapsack/badge.svg)](https://computational-problem-solving.github.io/knapsack/source.html)
[![Package size](https://img.shields.io/bundlephobia/minzip/@problem-solving/knapsack)](https://bundlephobia.com/result?p=@problem-solving/knapsack)

## :book: References

Expand Down
2 changes: 1 addition & 1 deletion doc/manual/example.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Examples

> More examples in [the test files](https://github.com/aureooms/js-knapsack/tree/main/test/src).
> More examples in [the test files](https://github.com/computational-problem-solving/knapsack/tree/main/test/src).
6 changes: 3 additions & 3 deletions doc/manual/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ or [jspm](https://jspm.org/docs).

### yarn
```terminal
yarn add @aureooms/js-knapsack
yarn add @problem-solving/knapsack
```

### npm
```terminal
npm install @aureooms/js-knapsack --save
npm install @problem-solving/knapsack --save
```

### jspm
```terminal
jspm install npm:@aureooms/js-knapsack
jspm install npm:@problem-solving/knapsack
```
4 changes: 2 additions & 2 deletions doc/manual/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'regenerator-runtime/runtime.js' ;

Then, import the library where needed
```js
const knapsack = require( '@aureooms/js-knapsack' ) ;
const knapsack = require( '@problem-solving/knapsack' ) ;
// or
import * as knapsack from '@aureooms/js-knapsack' ;
import * as knapsack from '@problem-solving/knapsack' ;
```
4 changes: 2 additions & 2 deletions doc/scripts/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const domReady = function (callback) {
domReady(() => {
const projectname = document.createElement('a');
projectname.classList.add('project-name');
projectname.text = 'aureooms/js-knapsack';
projectname.text = 'problem-solving/knapsack';
projectname.href = './index.html';

const header = document.querySelectorAll('header')[0];
header.insertBefore(projectname, header.firstChild);

const testlink = document.querySelector('header > a[data-ice="testLink"]');
testlink.href = 'https://coveralls.io/github/aureooms/js-knapsack';
testlink.href = 'https://coveralls.io/github/problem-solving/knapsack';
testlink.target = '_BLANK';

const searchBox = document.querySelector('.search-box');
Expand Down
37 changes: 21 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@aureooms/js-knapsack",
"name": "@problem-solving/knapsack",
"description": "Knapsack problem algorithms for JavaScript",
"version": "0.0.0",
"author": "aureooms",
"author": "make-github-pseudonymous-again",
"ava": {
"files": [
"test/src/**/*"
Expand Down Expand Up @@ -74,37 +74,42 @@
}
},
"bugs": {
"url": "https://github.com/aureooms/js-knapsack/issues"
"url": "https://github.com/computational-problem-solving/knapsack/issues"
},
"dependencies": {
"@aureooms/js-compare": "^1.4.8",
"@aureooms/js-itertools": "^5.0.0"
"@iterable-iterator/filter": "^1.0.1",
"@iterable-iterator/map": "^1.0.1",
"@iterable-iterator/range": "^2.1.0",
"@iterable-iterator/reduce": "^1.0.1",
"@iterable-iterator/sorted": "^1.0.0",
"@total-order/key": "^1.0.0",
"@total-order/primitive": "^1.0.1"
},
"devDependencies": {
"@babel/cli": "7.13.10",
"@babel/core": "7.13.10",
"@babel/preset-env": "7.13.10",
"@babel/register": "7.13.8",
"ava": "3.15.0",
"@babel/cli": "7.16.0",
"@babel/core": "7.16.5",
"@babel/preset-env": "7.16.5",
"@babel/register": "7.16.5",
"ava": "^3.15.0",
"babel-plugin-transform-remove-console": "6.9.4",
"babel-plugin-unassert": "3.0.1",
"babel-plugin-unassert": "3.2.0",
"babel-preset-power-assert": "3.0.0",
"coveralls": "3.1.0",
"coveralls": "3.1.1",
"esdoc": "1.1.0",
"esdoc-ecmascript-proposal-plugin": "1.0.0",
"esdoc-inject-script-plugin": "1.0.0",
"esdoc-inject-style-plugin": "1.0.0",
"esdoc-standard-plugin": "1.0.0",
"np": "7.4.0",
"np": "7.6.0",
"nyc": "15.1.0",
"power-assert": "1.6.1",
"regenerator-runtime": "0.13.7",
"regenerator-runtime": "0.13.9",
"xo": "0.36.1"
},
"files": [
"lib"
],
"homepage": "https://aureooms.github.io/js-knapsack",
"homepage": "https://computational-problem-solving.github.io/knapsack",
"keywords": [
"agpl",
"algorithms",
Expand All @@ -131,7 +136,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/aureooms/js-knapsack"
"url": "https://github.com/computational-problem-solving/knapsack"
},
"scripts": {
"build": "babel --delete-dir-on-start --env-name production src -d lib",
Expand Down
3 changes: 2 additions & 1 deletion src/integerValuesKnapsack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import assert from 'assert';
import {sum} from '@aureooms/js-itertools';

import {sum} from '@iterable-iterator/reduce';

/**
* Exact DP solution to the 0-1 knapsack problem with integer values given a known
Expand Down
6 changes: 4 additions & 2 deletions src/integerValuesKnapsackUnbounded.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import assert from 'assert';
import {increasing} from '@aureooms/js-compare';
import {max, map, range} from '@aureooms/js-itertools';
import {increasing} from '@total-order/primitive';
import {max} from '@iterable-iterator/reduce';
import {map} from '@iterable-iterator/map';
import {range} from '@iterable-iterator/range';

/**
* Exact DP solution to the unbounded knapsack problem with integer values
Expand Down
7 changes: 5 additions & 2 deletions src/knapsackApprox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import assert from 'assert';
import {increasing} from '@aureooms/js-compare';
import {max, map, filter, range} from '@aureooms/js-itertools';
import {increasing} from '@total-order/primitive';
import {max} from '@iterable-iterator/reduce';
import {map} from '@iterable-iterator/map';
import {filter} from '@iterable-iterator/filter';
import {range} from '@iterable-iterator/range';

import integerValuesKnapsack from './integerValuesKnapsack';

Expand Down
5 changes: 4 additions & 1 deletion src/knapsackGreedy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import assert from 'assert';
import {map, range, sorted, filter} from '@aureooms/js-itertools';
import {map} from '@iterable-iterator/map';
import {range} from '@iterable-iterator/range';
import {sorted} from '@iterable-iterator/sorted';
import {filter} from '@iterable-iterator/filter';

import Item from './Item';
import orderedByDecreasingUtility from './orderedByDecreasingUtility';
Expand Down
4 changes: 3 additions & 1 deletion src/knapsackUnboundedGreedy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import assert from 'assert';
import {map, range, sorted} from '@aureooms/js-itertools';
import {map} from '@iterable-iterator/map';
import {range} from '@iterable-iterator/range';
import {sorted} from '@iterable-iterator/sorted';

import Item from './Item';
import orderedByDecreasingUtility from './orderedByDecreasingUtility';
Expand Down
5 changes: 3 additions & 2 deletions src/orderedByDecreasingUtility.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {fn, decreasing} from '@aureooms/js-compare';
import {decreasing} from '@total-order/primitive';
import {key} from '@total-order/key';

const utility = (x) => x.v / x.w;
const orderedByDecreasingUtility = fn(decreasing, utility);
const orderedByDecreasingUtility = key(decreasing, utility);

export default orderedByDecreasingUtility;
3 changes: 2 additions & 1 deletion test/src/0-1-knapsack-problem.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import test from 'ava';

import {all, map} from '@aureooms/js-itertools';
import {all} from '@iterable-iterator/reduce';
import {map} from '@iterable-iterator/map';

import {
integerValuesKnapsack,
Expand Down
3 changes: 2 additions & 1 deletion test/src/unbounded-knapsack-problem.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import test from 'ava';

import {all, map} from '@aureooms/js-itertools';
import {all} from '@iterable-iterator/reduce';
import {map} from '@iterable-iterator/map';

import {
integerValuesKnapsackUnbounded,
Expand Down
Loading

0 comments on commit 3049f7d

Please sign in to comment.