Skip to content

Commit

Permalink
Rename from jupyterlab-datalogger to jupyterlab-datalogs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhad6 committed Apr 16, 2024
1 parent dd4a83e commit 8155376
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 71 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on: workflow_dispatch
env:
HATCH_VERSION: "1.9.1"
PACKAGE_VERSION: "0.4.1"
PACKAGE_NAME: "jupyterlab-datalogger"
PYTHON_PACKAGE_NAME: "jupyterlab_datalogger"
PACKAGE_NAME: "jupyterlab-datalogs"
PYTHON_PACKAGE_NAME: "jupyterlab_datalogs"

jobs:
build:
Expand Down
23 changes: 14 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Renamed package from `jupyterlab-datalogger` to `jupyterlab-datalogs` to be consistent
with the renamed DataLogs package.

## [0.4.1] (Jan 19 2024)

### Fixed
Expand Down Expand Up @@ -53,12 +58,12 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Added

- JupyterLab plugin to add NetCDF mimetype and file icon.
- JupyterLab plugin that adds shortcuts to generate code that loads logs with DataLogger.

[unreleased]: https://github.com/PainterQubits/jupyterlab-datalogger/compare/v0.4.1...main
[0.4.1]: https://github.com/PainterQubits/jupyterlab-datalogger/releases/tag/v0.4.1
[0.4.0]: https://github.com/PainterQubits/jupyterlab-datalogger/releases/tag/v0.4.0
[0.3.1]: https://github.com/PainterQubits/jupyterlab-datalogger/releases/tag/v0.3.1
[0.3.0]: https://github.com/PainterQubits/jupyterlab-datalogger/releases/tag/v0.3.0
[0.2.0]: https://github.com/PainterQubits/jupyterlab-datalogger/releases/tag/v0.2.0
[0.1.0]: https://github.com/PainterQubits/jupyterlab-datalogger/releases/tag/v0.1.0
- JupyterLab plugin that adds shortcuts to generate code that loads logs with DataLogs.

[unreleased]: https://github.com/PainterQubits/jupyterlab-datalogs/compare/v0.4.1...main
[0.4.1]: https://github.com/PainterQubits/jupyterlab-datalogs/releases/tag/v0.4.1
[0.4.0]: https://github.com/PainterQubits/jupyterlab-datalogs/releases/tag/v0.4.0
[0.3.1]: https://github.com/PainterQubits/jupyterlab-datalogs/releases/tag/v0.3.1
[0.3.0]: https://github.com/PainterQubits/jupyterlab-datalogs/releases/tag/v0.3.0
[0.2.0]: https://github.com/PainterQubits/jupyterlab-datalogs/releases/tag/v0.2.0
[0.1.0]: https://github.com/PainterQubits/jupyterlab-datalogs/releases/tag/v0.1.0
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# DataLogger JupyterLab
# DataLogs JupyterLab

JupyterLab extension for DataLogger.
JupyterLab extension for DataLogs.

## Installation

Install the latest version of DataLogger JupyterLab using pip:
Install the latest version of JupyterLab DataLogs using pip:

```
pip install -U jupyterlab-datalogger --extra-index-url https://painterqubits.github.io/jupyterlab-datalogger/releases
pip install -U jupyterlab-datalogs --extra-index-url https://painterqubits.github.io/jupyterlab-datalogs/releases
```

This extension should run alongside
[JupyterLab](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html)
version 4 (included with the `jupyterlab` extra). There are also a set of packages
required for analysis using DataLogger notebooks (included with the `analysis` extra), and
required for analysis using DataLogs notebooks (included with the `analysis` extra), and
a set of recommended JupyterLab plugins (included with the `plugins` extra).

To automatically install with all of these extras, use the `all` extra:

```
pip install -U "jupyterlab-datalogger[all]" --extra-index-url https://painterqubits.github.io/jupyterlab-datalogger/releases
pip install -U "jupyterlab-datalogs[all]" --extra-index-url https://painterqubits.github.io/jupyterlab-datalogs/releases
```

While the Real-Time Collaboration extension is included in the `plugins` extra for
Expand All @@ -43,13 +43,13 @@ To develop, the following dependencies must be installed:
Then, run

```bash
yarn
hatch run ci:jlpm
```

to install Node.js dependencies, and

```bash
yarn dev
hatch run dev
```

to build the extension and start up a JupyterLab server. The first time you do this, also
Expand All @@ -59,9 +59,10 @@ changes, it should automatically rebuild, and the updated extension will be used
page is reloaded.

> [!NOTE]
> On Windows, symbolic links must be activated for `yarn dev` to work. On Windows 10 or
> above for Python version 3.8 or higher, this can be done by
> On Windows, symbolic links must be activated for `hatch run dev` to work. On Windows 10
> or above for Python version 3.8 or higher, this can be done by
> [activating developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development).
>
> Alternatively, you can run `yarn preview` to rebuild and reinstall the extension each
> time the source code changes.
> Alternatively, you can run `hatch run build` to rebuild and reinstall the extension each
> time the source code changes, and `hatch run jupyter lab` to start a new JupyterLab
> server.
4 changes: 2 additions & 2 deletions install.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packageManager": "python",
"packageName": "jupyterlab-datalogger",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab-datalogger."
"packageName": "jupyterlab-datalogs",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab-datalogs."
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""JupyterLab extension for DataLogger."""
"""JupyterLab extension for DataLogs."""


# Required for symlinking in development ("jupyter labextension develop --overwrite .")
def _jupyter_labextension_paths() -> list[dict[str, str]]:
return [{"src": "../labextension", "dest": "jupyterlab-datalogger"}]
return [{"src": "../labextension", "dest": "jupyterlab-datalogs"}]
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "jupyterlab-datalogger",
"name": "jupyterlab-datalogs",
"private": true,
"version": "0.4.1",
"description": "JupyterLab extension for DataLogger.",
"description": "JupyterLab extension for DataLogs.",
"contributors": [
{
"name": "Alex Hadley",
Expand All @@ -15,8 +15,8 @@
"jupyterlab",
"jupyterlab-extension"
],
"homepage": "https://github.com/PainterQubits/jupyterlab-datalogger",
"repository": "github:PainterQubits/jupyterlab-datalogger",
"homepage": "https://github.com/PainterQubits/jupyterlab-datalogs",
"repository": "github:PainterQubits/jupyterlab-datalogs",
"main": "lib/index.js",
"jupyterlab": {
"extension": true,
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling", "hatch-nodejs-version", "jupyterlab>=4.0.10,<5"]
build-backend = "hatchling.build"

[project]
name = "jupyterlab-datalogger"
name = "jupyterlab-datalogs"
license = { file = "LICENSE" }
readme = "README.md"
classifiers = [
Expand All @@ -24,10 +24,10 @@ requires-python = ">=3.9"
dynamic = ["version", "description", "authors", "urls", "keywords"]

[project.optional-dependencies]
all = ["jupyterlab-datalogger[jupyterlab,analysis,plugins]"]
all = ["jupyterlab-datalogs[jupyterlab,analysis,plugins]"]
jupyterlab = ["jupyterlab>=4.0.10,<5"]
analysis = [
"datalogger @ https://painterqubits.github.io/datalogger/latest.tar.gz",
"datalogs @ https://painterqubits.github.io/datalogs/latest.tar.gz",
"numpy>=1.26.3,<2",
"xarray>=2023.12.0",
"matplotlib>=3.8.2,<4",
Expand All @@ -51,8 +51,8 @@ fields = ["description", "authors", "urls", "keywords"]
artifacts = ["labextension"]

[tool.hatch.build.targets.wheel.shared-data]
"labextension" = "share/jupyter/labextensions/jupyterlab-datalogger"
"install.json" = "share/jupyter/labextensions/jupyterlab-datalogger/install.json"
"labextension" = "share/jupyter/labextensions/jupyterlab-datalogs"
"install.json" = "share/jupyter/labextensions/jupyterlab-datalogs/install.json"

[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder>=0.8.3"]
Expand All @@ -69,14 +69,14 @@ description = "For running JupyterLab in development"
dependencies = [
"jupyterlab>=4.0.10,<5",
"jupyter-collaboration>=2.0.1,<3",
"datalogger>=0.3.0",
"datalogs>=0.3.0",
"numpy>=1.26.3,<2",
"xarray>=2023.12.0",
"matplotlib>=3.8.2,<4",
]

[tool.hatch.envs.default.env-vars]
PIP_EXTRA_INDEX_URL = "https://painterqubits.github.io/datalogger/releases"
PIP_EXTRA_INDEX_URL = "https://painterqubits.github.io/datalogs/releases"

[tool.hatch.envs.default.scripts]
dev = "jlpm dev"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "DataLogger Load Code",
"description": "Shortcuts to generate code that loads logs with DataLogger.",
"title": "DataLogs Load Code",
"description": "Shortcuts to generate code that loads logs with DataLogs.",
"jupyter.lab.menus": {
"main": [
{
Expand All @@ -12,7 +12,7 @@
"id": "jp-mainmenu-file-new",
"items": [
{
"command": "jupyterlab-datalogger:datalogger-notebook-command",
"command": "jupyterlab-datalogs:datalogs-notebook-command",
"rank": 20
}
]
Expand All @@ -23,12 +23,12 @@
],
"context": [
{
"command": "jupyterlab-datalogger:add-datalogger-load-code-command",
"command": "jupyterlab-datalogs:add-datalogs-load-code-command",
"selector": ".jp-DirListing-item[data-isdir=\"false\"]",
"rank": 3
},
{
"command": "jupyterlab-datalogger:new-datalogger-notebook-command",
"command": "jupyterlab-datalogs:new-datalogs-notebook-command",
"selector": ".jp-DirListing-content",
"rank": 53
}
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const PACKAGE_NAME = "jupyterlab-datalogger";
export const PACKAGE_NAME = "jupyterlab-datalogs";

// Mimetypes
export const JSON_MIMETYPE = "application/json";
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { netcdfFileTypePlugin, dataloggerLoadCodePlugin } from "@/plugins";
import { netcdfFileTypePlugin, datalogsLoadCodePlugin } from "@/plugins";

export default [netcdfFileTypePlugin, dataloggerLoadCodePlugin];
export default [netcdfFileTypePlugin, datalogsLoadCodePlugin];
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ import { chartLineIcon, chartLineIconUrl } from "@/icons";

const logMimetypes = new Set([JSON_MIMETYPE, NETCDF_MIMETYPE]);

const dataloggerNotebookImports = [
const datalogsNotebookImports = [
"import numpy as np",
"import xarray as xr",
"import matplotlib.pyplot as plt",
"from datalogger import load_log, DictLog, DataLog",
"from datalogs import load_log, DictLog, DataLog",
];

/**
* Along with its corresponding schema (schema/datalogger-load-code.json), this plugin
* Along with its corresponding schema (schema/datalogs-load-code.json), this plugin
* adds items to the file browser context menu, the main menu, and the Launcher to
* add code to notebooks for loading log files using DataLogger.
* add code to notebooks for loading log files using DataLogs.
*/
export const dataloggerLoadCodePlugin: JupyterFrontEndPlugin<void> = {
id: `${PACKAGE_NAME}:datalogger-load-code-plugin`,
description: "Shortcuts to generate code that loads logs with DataLogger.",
export const datalogsLoadCodePlugin: JupyterFrontEndPlugin<void> = {
id: `${PACKAGE_NAME}:datalogs-load-code-plugin`,
description: "Shortcuts to generate code that loads logs with DataLogs.",
autoStart: true,
requires: [ILauncher, IFileBrowserFactory, INotebookTracker],
activate(
Expand All @@ -32,8 +32,8 @@ export const dataloggerLoadCodePlugin: JupyterFrontEndPlugin<void> = {
{ tracker: fileBrowserTracker }: IFileBrowserFactory,
notebookTracker: INotebookTracker,
) {
commands.addCommand(`${PACKAGE_NAME}:add-datalogger-load-code-command`, {
label: "Add DataLogger Load Code",
commands.addCommand(`${PACKAGE_NAME}:add-datalogs-load-code-command`, {
label: "Add DataLogs Load Code",
icon: addIcon,
execute: async () => {
const { currentWidget: fileBrowser } = fileBrowserTracker;
Expand Down Expand Up @@ -63,7 +63,7 @@ export const dataloggerLoadCodePlugin: JupyterFrontEndPlugin<void> = {
},
});

async function newDataloggerNotebook() {
async function newDatalogsNotebook() {
// Create a new notebook
const notebookPanel: NotebookPanel = await commands.execute("notebook:create-new");
await notebookPanel.context.ready;
Expand All @@ -74,7 +74,7 @@ export const dataloggerLoadCodePlugin: JupyterFrontEndPlugin<void> = {
insertLocation: "currentCell",
cellType: "markdown",
});
await addToNotebook(notebook, dataloggerNotebookImports.join("\n"));
await addToNotebook(notebook, datalogsNotebookImports.join("\n"));
await addToNotebook(notebook, "## Load Logs", { cellType: "markdown" });
await addToNotebook(notebook);
NotebookActions.renderAllMarkdown(notebook);
Expand All @@ -84,32 +84,32 @@ export const dataloggerLoadCodePlugin: JupyterFrontEndPlugin<void> = {
}

// Used in file browser context menu
commands.addCommand(`${PACKAGE_NAME}:new-datalogger-notebook-command`, {
label: "New DataLogger Notebook",
commands.addCommand(`${PACKAGE_NAME}:new-datalogs-notebook-command`, {
label: "New DataLogs Notebook",
icon: chartLineIcon,
execute: newDataloggerNotebook,
execute: newDatalogsNotebook,
});

// Used in main menu File > New
commands.addCommand(`${PACKAGE_NAME}:datalogger-notebook-command`, {
label: "DataLogger Notebook",
commands.addCommand(`${PACKAGE_NAME}:datalogs-notebook-command`, {
label: "DataLogs Notebook",
icon: chartLineIcon,
execute: newDataloggerNotebook,
execute: newDatalogsNotebook,
});

// Used in Launcher
commands.addCommand(`${PACKAGE_NAME}:datalogger-command`, {
label: "DataLogger",
commands.addCommand(`${PACKAGE_NAME}:datalogs-command`, {
label: "DataLogs",
icon: chartLineIcon,
execute: newDataloggerNotebook,
execute: newDatalogsNotebook,
});

launcher.add({
category: "Notebook",
command: `${PACKAGE_NAME}:datalogger-command`,
command: `${PACKAGE_NAME}:datalogs-command`,
kernelIconUrl: chartLineIconUrl,
});
},
};

export default dataloggerLoadCodePlugin;
export default datalogsLoadCodePlugin;
2 changes: 1 addition & 1 deletion src/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./netcdfFileTypePlugin";
export * from "./dataloggerLoadCodePlugin";
export * from "./datalogsLoadCodePlugin";
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3842,9 +3842,9 @@ __metadata:
languageName: node
linkType: hard

"jupyterlab-datalogger@workspace:.":
"jupyterlab-datalogs@workspace:.":
version: 0.0.0-use.local
resolution: "jupyterlab-datalogger@workspace:."
resolution: "jupyterlab-datalogs@workspace:."
dependencies:
"@jupyterlab/application": ^4.1.0
"@jupyterlab/builder": ^4.1.0
Expand Down

0 comments on commit 8155376

Please sign in to comment.