Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ coverage/
TODO.md
CONTEXT*
todo*
todo.md
TODO.md
CONCEPT*
CONCEPT2*
plan.md
DOCS.md
UI.md

# Examples
examples/
124 changes: 124 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,130 @@ Project structure is in [`README.md`](./README.md#-package-structure)

---

## 🕊 Git Workflow and Branch Structure

For project organization, we use the following branch structure:

### 📌 Main Branches:

* `main`
* Production version.
* Ready for release.
* Each commit is stable and tested code.

* `dev`
* Main development branch.
* All completed feature branches are merged here.
* May contain minor bugs and improvements in progress.
* Regularly undergoes integration testing.

### 📌 Feature Branches:

For each task, issue, or feature, create a separate branch from `dev`:

* Naming format:

```bash
feature/<feature-name>
fix/<issue-name-or-number>
refactor/<description>
```

Examples:

* `feature/lazy-computation`
* `fix/null-pointer-issue-32`
* `refactor/dataframe-optimizations`

After completing work on the task:

* ✅ Create a Pull Request (PR) from the feature branch to the `dev` branch.
* ✅ Conduct code review and testing.
* ✅ After successful review, merge into `dev`.
* ✅ Delete the feature branch after merging.

### 📌 Hotfix Branches (Emergency Fixes):

If a serious error is discovered in a release (the `main` branch), we quickly fix it through a special `hotfix` branch from `main`:

* Naming format:

```bash
hotfix/<critical-issue>
```

Example:

* `hotfix/dataframe-critical-bug`

After fixing:

* ✅ Merge the `hotfix` branch into `main`.
* ✅ Then merge `main` back into `dev` to incorporate the fixes into the development branch.

### 📌 Complete Workflow Process:

```
main (stable)
├─ dev (development)
│ ├─ feature/lazy-computation
│ ├─ feature/arrow-integration
│ ├─ fix/null-pointer-issue-32
│ └─ refactor/dataframe-optimizations
└─ hotfix/dataframe-critical-bug (if urgent fix needed)
```

### 📊 Steps Before Release (when updating main):

1. ✅ Verify that the `dev` branch is fully stable and tested.
2. ✅ Create a release PR from the `dev` branch to `main`.
3. ✅ Conduct final review, CI/CD tests, and regression tests.
4. ✅ Merge the PR into `main`.
5. ✅ Create a git release tag (e.g., `v1.0.0`) to mark the stable release point.

Example:

```bash
git checkout main
git merge dev
git tag v1.0.0
git push origin main --tags
```

### ⚙️ Supporting Tools and Practices (Best Practices):

* ✅ **Pull Requests (PR)**:
Perform mandatory code reviews and tests before merging.

* ✅ **Automation through CI/CD (GitHub Actions)**:
Run automated testing, linting, and benchmarking.

* ✅ **Branch protection rules** on GitHub:
Protect `main` and `dev` branches from accidental direct commits.
Configure mandatory PR reviews before merging.

* ✅ **Semantic Versioning (SemVer)**:
Strictly follow semantic versioning (`1.0.0`, `1.1.0`, `1.1.1`).

### 📎 Example of Semantic Versioning Approach:

* `1.0.0` — first stable release.
* `1.0.1` — bug fixes and minor corrections.
* `1.1.0` — new features that maintain backward compatibility.
* `2.0.0` — release with changes that break backward compatibility.

### ✅ **Daily Work Recommendations (Best Practices):**

* Commit small changes frequently with informative messages.
* Create issues and PRs for each task.
* Regularly merge the `dev` branch into your feature branches to avoid conflicts.
* Use Squash/Merge commits for a clean history.
* Monitor stability and test coverage through CI/CD.

---

## 🚀 Getting Started

1. **Fork this repo** on GitHub
Expand Down
2 changes: 0 additions & 2 deletions alt.txt

This file was deleted.

89 changes: 89 additions & 0 deletions fix-test-imports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* Script for fixing import paths in tests
*
* This script fixes import paths in tests to match
* the actual project structure.
*/

import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

// Get current directory for ES modules
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// Function for recursive directory traversal
function walkDir(dir, callback) {
fs.readdirSync(dir).forEach((f) => {
const dirPath = path.join(dir, f);
const isDirectory = fs.statSync(dirPath).isDirectory();
if (isDirectory) {
walkDir(dirPath, callback);
} else if (f.endsWith('.test.js')) {
callback(path.join(dir, f));
}
});
}

// Function for fixing import paths in tests
function fixImports(filePath) {
console.log(`Fixing imports in file: ${filePath}`);

try {
let content = fs.readFileSync(filePath, 'utf8');

// Fix path to DataFrame
content = content.replace(
/import\s+{\s*DataFrame\s*}\s+from\s+['"](.*)\/core\/DataFrame\.js['"]/g,
'import { DataFrame } from \'$1/core/dataframe/DataFrame.js\'',
);

// Fix path to Series
content = content.replace(
/import\s+{\s*Series\s*}\s+from\s+['"](.*)\/core\/Series\.js['"]/g,
'import { Series } from \'$1/core/dataframe/Series.js\'',
);

// Fix import from chai to vitest
content = content.replace(
/import\s+{\s*expect\s*}\s+from\s+['"]chai['"]/g,
'import { expect } from \'vitest\'',
);

// Fix issue with duplicate df variable
const dfRegex =
/const\s+df\s*=\s*createDataFrameWithStorage\(DataFrame,\s*testData,\s*storageType\);/g;
const matches = content.match(dfRegex);

if (matches && matches.length > 0) {
// If df is already created with testWithBothStorageTypes, remove other df declarations
const dfCreationRegex = /const\s+df\s*=\s*DataFrame\.create\([^)]+\);/g;
content = content.replace(
dfCreationRegex,
'// df created above using createDataFrameWithStorage',
);
}

// Write updated file content
fs.writeFileSync(filePath, content, 'utf8');
console.log(` Imports successfully fixed: ${filePath}`);
} catch (error) {
console.error(` Error fixing imports in file ${filePath}:`, error);
}
}

// Function to start fixing imports
async function main() {
// Fix imports in the test/methods directory
const testDir = path.join(__dirname, 'test', 'methods');
walkDir(testDir, fixImports);

console.log('Import fixing completed!');
}

// Run the script
main().catch((error) => {
console.error('Error fixing imports:', error);
process.exit(1);
});
3 changes: 0 additions & 3 deletions output.csv

This file was deleted.

3 changes: 0 additions & 3 deletions output.tsv

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
}
},
"dependencies": {
"apache-arrow": "^20.0.0",
"chart.js": "^4.4.9",
"exceljs": "^4.4.0"
},
Expand Down
Loading