Skip to content

Commit e021cc0

Browse files
docs: improve doc structure (pola-rs#33)
* fix build errors * fix build errors * docs: wip - improve doc structure * update tsconfig * docs: add CONTRIBUTING.md * use rome instead of eslint * update yarn lock
1 parent ca8b7b8 commit e021cc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6408
-7162
lines changed

.eslintrc.json

-82
This file was deleted.

.yarn/install-state.gz

418 KB
Binary file not shown.

@types/jest.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {DataFrame} from "@polars/dataframe";
2-
import {Series} from "@polars/series/series";
2+
import {Series} from "@polars/series";
33

44
declare global {
55
namespace jest {
@@ -12,11 +12,11 @@ declare global {
1212
*
1313
* @example
1414
* ```
15-
* >>> df = pl.Dataframe([pl.Series("int32": [1,2], pl.Int32)])
16-
* >>> other = pl.Dataframe([pl.Series("int32": [1,2], pl.UInt32)])
15+
* > df = pl.Dataframe([pl.Series("int32": [1,2], pl.Int32)])
16+
* > other = pl.Dataframe([pl.Series("int32": [1,2], pl.UInt32)])
1717
*
18-
* >>> expect(df).toFrameEqual(other) // passes
19-
* >>> expect(df).toFrameStrictEqual(other) // fails
18+
* > expect(df).toFrameEqual(other) // passes
19+
* > expect(df).toFrameStrictEqual(other) // fails
2020
* ```
2121
*/
2222
toFrameStrictEqual(b: DataFrame): R;

CONTRIBUTING.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Contributing to nodejs-polars
2+
3+
First of all, thank you for considering contributing to nodejs-polars!
4+
5+
The following is a set of guidelines for contributing to nodejs-polars. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
6+
7+
## How Can I Contribute?
8+
9+
### Reporting Bugs
10+
11+
- **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/pola-rs/nodejs-polars/issues).
12+
13+
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
14+
15+
- If possible, use the relevant bug report templates to create the issue.
16+
17+
### Suggesting Enhancements
18+
19+
- Open a new GitHub issue in the [Issues](https://github.com/pola-rs/nodejs-polars/issues) with a **clear title** and **description**.
20+
21+
- If possible, use the relevant enhancement request templates to create the issue.
22+
23+
24+
### Pull Requests
25+
26+
- Fill in the required template
27+
- Use a descriptive title. *(This will end up in the changelog)*
28+
- In the pull request description, link to the issue you were working on.
29+
- Add any relevant information to the description that you think may help the maintainers review your code.
30+
- Make sure your branch is [rebased](https://docs.github.com/en/get-started/using-git/about-git-rebase) against the latest version of the `main` branch.
31+
- Make sure all GitHub Actions checks pass.
32+
33+
34+
35+
## Development
36+
### Vscode
37+
If using VScode, it is recommended to install the following extensions
38+
- rust-analyzer
39+
- rome
40+
---
41+
42+
- Fork the repository, then clone it from your fork
43+
```
44+
git clone https://github.com/<your-github-username>/nodejs-polars.git
45+
```
46+
47+
- Install dependencies
48+
```
49+
yarn install
50+
```
51+
52+
- Build the binary
53+
```
54+
yarn build:debug
55+
```
56+
57+
- Run the tests
58+
```
59+
yarn jest
60+
```
61+
62+
- Make your changes
63+
- Test your changes
64+
-
65+
You can run the `precommit` command to make sure all of your tests pass & code is formatted correctly.
66+
```
67+
yarn precommit
68+
```
69+
70+
- Update the documentation if necessary
71+
- Create a new pull request

README.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -21,47 +21,45 @@ const pl = require('nodejs-polars');
2121
### Series
2222

2323
```js
24-
>>> const fooSeries = pl.Series("foo", [1, 2, 3])
25-
>>> fooSeries.sum()
24+
> const fooSeries = pl.Series("foo", [1, 2, 3])
25+
> fooSeries.sum()
2626
6
2727

2828
// a lot operations support both positional and named arguments
2929
// you can see the full specs in the docs or the type definitions
30-
>>> fooSeries.sort(true)
31-
>>> fooSeries.sort({reverse: true})
30+
> fooSeries.sort(true)
31+
> fooSeries.sort({reverse: true})
3232
shape: (3,)
3333
Series: 'foo' [f64]
3434
[
3535
3
3636
2
3737
1
3838
]
39-
>>> fooSeries.toArray()
39+
> fooSeries.toArray()
4040
[1, 2, 3]
4141

4242
// Series are 'Iterables' so you can use javascript iterable syntax on them
43-
>>> [...fooSeries]
43+
> [...fooSeries]
4444
[1, 2, 3]
4545

46-
>>> fooSeries[0]
46+
> fooSeries[0]
4747
1
4848

4949
```
5050

5151
### DataFrame
5252

5353
```js
54-
>>> const df = pl.DataFrame(
54+
>const df = pl.DataFrame(
5555
... {
5656
... A: [1, 2, 3, 4, 5],
5757
... fruits: ["banana", "banana", "apple", "apple", "banana"],
5858
... B: [5, 4, 3, 2, 1],
5959
... cars: ["beetle", "audi", "beetle", "beetle", "beetle"],
6060
... }
6161
... )
62-
>>> df
63-
... .sort("fruits")
64-
... .select(
62+
> df.sort("fruits").select(
6563
... "fruits",
6664
... "cars",
6765
... pl.lit("fruits").alias("literal_string_fruits"),
@@ -90,7 +88,7 @@ shape: (5, 8)
9088
```
9189

9290
```js
93-
>>> df["cars"] // or df.getColumn("cars")
91+
> df["cars"] // or df.getColumn("cars")
9492
shape: (5,)
9593
Series: 'cars' [str]
9694
[

__tests__/complex_types.test.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
import pl from "@polars";
22

3-
43
describe("complex types", () => {
5-
64
test.skip("nested arrays round trip", () => {
75
const arr = [[["foo"]], [], null];
86
const s = pl.Series("", arr);
97
const actual = s.toArray();
108
expect(actual).toEqual(arr);
119
});
1210
test.skip("struct arrays round trip", () => {
13-
const arr = [{foo: "a", bar: 1}, null, null];
11+
const arr = [{ foo: "a", bar: 1 }, null, null];
1412
const s = pl.Series("", arr);
1513
const actual = s.toArray();
1614
expect(actual).toEqual(arr);
1715
});
18-
1916
});

0 commit comments

Comments
 (0)