Skip to content

Update VS Code local tutorial launching note & fix Java tutorial code… #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2023
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "ghcr.io/lonrun/codefuse-query-tutorial:0.5",
"image": "ghcr.io/lonrun/codefuse-query-tutorial:0.6",
"hostRequirements": {
"cpus": 4
},
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ CodeFuse-Query为CodeFuse代码大模型提供了以下数据清洗能力:
- `language`:各语言的数据化核心(extractor)和数据建模(lib)。关于开放度的问题,请参见《关于开源范围的一些说明》章节
- `doc`:参考文档
- `examples`:Gödel 查询语言示例
- `tutorial`:CodeFuse-Query 开发容器使用教程

## 关于开源范围的一些说明
截止目前,从源码**不能**构建出可执行的程序,原因在于本次开源并没有开放所有的模块,缺少的模块会在之后的一年陆续开源。尽管如此,为保障完整的体验,我们开放了**完整的安装包**下载,请见Release页面。
Expand Down
18 changes: 15 additions & 3 deletions tutorial/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
## CodeFuse-Query使用教程

### 使用Github Codespaces 来体验CodeFuse-Query分析能力
我们编写了Jupyter Notebook形式的教程,你可以在 CodeFuse-Query 预置好的 Github Codespace 中打开,在阅读的同时执行代码,观察执行结果,也可以修改代码观察反馈,亲手体验 CodeFuse-Query 强大的自定义分析能力。
我们编写了Jupyter Notebook形式的教程,你可以使用项目配置的开发容器(devcontainer) 来体验 CodeFuse-Query,在阅读的同时执行代码,观察执行结果,也可以修改代码观察反馈,亲手体验 CodeFuse-Query 强大的自定义分析能力。

关于教程所运行的开发容器,你可以使用 GitHub Codespaces 功能进行远程加载体验,无需额外配置开发环境,通过浏览器访问,享受远程访问的便利性;也可以使用 VS Code在本地使用开发容器(dev container)功能体验 CodeFuse-Query 的使用教程(需要本地预装 VS Code和 Docker)。

#### 扩展阅读
- [Github Codespaces](https://github.com/features/codespaces)
- [Jupyter Notebook](https://jupyter.org/)
- [VS Code devcontainer](https://code.visualstudio.com/docs/devcontainers/containers)

### 1. 使用 Github Codespaces 来体验CodeFuse-Query分析能力

#### 体验步骤
1. 创建 Codespaces。依次点击项目首页的 Code -> Codespaces,在当前分支创建一个 Codespaces。
Expand All @@ -14,7 +18,15 @@
4. 在右上角的 "选择内核" 弹出框中,依次选择 "Jupyter Kernel..." -> "Godel Kernel"。
5. 开始体验。

### Jupyter kernel for CodeFuse-Query 介绍
### 2. 使用 VS Code 本地开发容器来体验CodeFuse-Query分析能力

#### 体验步骤
1. 克隆代码到本地,然后使用VS Code 打开项目
2. VS Code 会自动检测到 devcontainer 配置文件( .devcontainer/devcontainer.json)。它将会提示你是否要重新打开仓库以应用 devcontainer 配置。点击「重新打开」按钮即可。
3. 加载完成后,切换至项目 tutorial/notebook 目录下
4. 选择示例下的 Jupyter Notebook 分析教程,即可开始体验

## Jupyter kernel for CodeFuse-Query 介绍
Jupyter kernel for CodeFuse-Query(以下称 Godel Kernel) 是 Jupyter 的一个特定内核,它为 Jupyter 环境提供了与 CodeFuse-Query 相关的交互式功能。该内核提供以下能力:
- 支持在 Jupyter Notebook 中编写和执行 Godel 脚本。
- 支持 `%%python` 命令编写并执行 Python 代码,以便对查询到的数据进行更深入的数据可视化和数据后处理操作。
Expand Down
2 changes: 1 addition & 1 deletion tutorial/notebook/java_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
" m in Callable(db()),\n",
" c in Class(db())\n",
"where\n",
" c.id = m.getBelongedClass().id\n",
" c.key_eq(m.getBelongedClass())\n",
"select\n",
" c.getQualifiedName() as className,\n",
" m.getName() as methodName,\n",
Expand Down