Skip to content

Commit

Permalink
ci: show all todos
Browse files Browse the repository at this point in the history
  • Loading branch information
jojocys committed Nov 29, 2022
1 parent d2cabfe commit fe41774
Show file tree
Hide file tree
Showing 33 changed files with 53 additions and 51 deletions.
3 changes: 1 addition & 2 deletions apps/desktop/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { app, BrowserWindow } = require('electron')
// TODO: test todo bot
const path = require('path');
// const path = require('path');
// const app_path = path.resolve(__dirname, './build/index.html')
// console.log(app_path)
let win;
Expand Down
6 changes: 3 additions & 3 deletions packages/rath-client/src/dev/workers/engine/dateTimeExpand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ const UnknownDateTimeInfo: DateTimeInfo = {}
type InfoArrayType = keyof DateTimeInfoArray
export type DateTimeInfoType = keyof DateTimeInfo
export function parseDateTimeArray(dateTime: string[]): DateTimeInfoArray {
// TODO: Polyfills: 中文格式等
// TODO: assume the same dateTime format or support different format in one column
// TODO: [refactor] Polyfills: 中文格式等
// TODO: [feat] assume the same dateTime format or support different format in one column
let infoArray = {} as DateTimeInfoArray
let reg_id: number | undefined, max_cnt = 0;
for (let i = 0; i < analyzer.rules.length; ++i) {
Expand All @@ -259,7 +259,7 @@ export function parseDateTimeArray(dateTime: string[]): DateTimeInfoArray {
max_cnt = cnt
}
}
// TODO: 推荐多种不同选择
// TODO: [feat] 推荐多种不同选择
for (let i = 0; i < dateTime.length; ++i) {
let info = parseDateTime(dateTime[i], max_cnt > 0 ? reg_id : undefined)
Object.keys(info).forEach(key => {
Expand Down
7 changes: 3 additions & 4 deletions packages/rath-client/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,19 @@ export const useCleanMethodList = function (): typeof cleanMethodList {

async function sendCertMail(email: string) {
const url = getServerUrl('/api/sendMailCert');
// TODO: email格式检查
// TODO: [feat] email format check
const res = await request.post<{ email: string }, string>(url, { email });
if (res) {
// console.log("邮件发送成功");
// console.log("mail sent success");
}
return res;
}

async function sendCertPhone(phone: string) {
const url = getServerUrl('/api/sendPhoneCert');
// TODO: email格式检查
const res = await request.post<{ phone: string }, string>(url, { phone });
if (res) {
// console.log("短信发送成功");
// console.log("message sent success");
}
return res;
}
Expand Down
6 changes: 4 additions & 2 deletions packages/rath-client/src/pages/causal/manualAnalyzer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ const ManualAnalyzer = forwardRef<{ onSubtreeSelected?: ExplorerProps['onNodeSel
}
: {};
// 散点图(分布矩阵)
// TODO: Graphic Walker 支持受控状态
// TODO: [feat] Graphic Walker 支持受控状态
// by kyusho, 2 weeks ago
// 多变量直方图现在存在支持问题:
// 1. GraphicWalker 解析 Specification 的规则导致不能叠加在 Column 上。
// 2. 不应该默认聚合。
// ----
// 多变量直方图
// TODO: GraphicWalker 支持 Vega bin
// TODO: [feat] GraphicWalker 支持 Vega bin
// kyusho, 2 weeks ago
// 多变量直方图现在存在支持问题:
// 1. GraphicWalker 不支持 vega bin,Specification 也传不了 bin。
// 2. GraphicWalker 解析 Specification 的规则导致不能叠加在 Column 上。
Expand Down
3 changes: 2 additions & 1 deletion packages/rath-client/src/pages/dashboard/dashboard-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ const DashboardPanel: FC<DashboardPanelProps> = ({ page, card, operators, sample
{({
collection: <SourcePanel page={page} card={card} operators={operators} sampleSize={sampleSize} />,
editor: <EditPanel page={page} card={card} operators={operators} sampleSize={sampleSize} />,
loa: null, // TODO:
loa: null, // TODO: [fix] LOA panel
// kyusho, 4 weeks ago (November 3rd, 2022 3:15 PM
} as const)[tab]}
</div>
</>
Expand Down
7 changes: 4 additions & 3 deletions packages/rath-client/src/pages/dashboard/renderer/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ export type RefLine = {
reason: (
| 'canvas-limit'
| 'align-other-card'
| 'other-card-size' // TODO: 还没有实现,而且需要额外考虑当前卡片位置
| 'card-padding' // TODO: 还没有实现
| 'canvas-padding' // TODO: 还没有实现
| 'other-card-size' // TODO: [feat] 还没有实现,other-card-size 而且需要额外考虑当前卡片位置
| 'card-padding' // TODO: [feat] 还没有实现 card-padding
| 'canvas-padding' // TODO: [feat] 还没有实现 canvas-padding
// kyusho, 5 days ago (November 24th, 2022 5:31 PM)
)[];
score: number;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/rath-client/src/pages/manualControl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '@kanaries/graphic-walker/dist/style.css';

const VisualInterface: React.FC = (props) => {
const { dataSourceStore, commonStore, langStore } = useGlobalStore();
// TODO: discuss use clean data from dataSourceStore or cooked data from dataPipeline?
// TODO: [discuss] discuss use clean data from dataSourceStore or cooked data from dataPipeline?
const { cleanedData, fields } = dataSourceStore;
const { graphicWalkerSpec } = commonStore;
const gwRawFields = useMemo<IMutField[]>(() => {
Expand Down
3 changes: 2 additions & 1 deletion packages/rath-client/src/store/collectionStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export class CollectionStore {
}
public collectionContains (fields: IFieldMeta[], spec: IVegaSubset, filters: IFilter[] | undefined = []) {
// FIXME
// TODO
// TODO: 这里还需要filter的信息,才能保证图表的唯一性。
// observedobserver, 2 months ago (October 14th, 2022 9:40 PM)
// 这里还需要filter的信息,才能保证图表的唯一性。
const vizCode = encodeViewKey(fields, spec, filters);
return this.vizHash.has(vizCode)
Expand Down
9 changes: 6 additions & 3 deletions packages/rath-client/src/store/dashboardStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,17 @@ export default class DashboardStore {
public static readonly rendererVersion = 1;

protected static writeDocumentObjectBlob(data: DashboardDocument): Blob {
// TODO: optimize
// TODO: [enhance] optimize
// kyusho, 4 weeks ago (November 1st, 2022 10:50 AM)
const part = JSON.stringify(data);
const file = new Blob([ part ], { type: 'text/plain' });
return file;
}

protected static async readObjectBlob(blob: Blob): Promise<DashboardDocument> {
const text = await blob.text();
// TODO: optimize
// TODO: [enhance] optimize
// kyusho, 4 weeks ago (November 1st, 2022 10:50 AM)
const data = JSON.parse(text) as DashboardDocument;
return data;
}
Expand Down Expand Up @@ -150,7 +152,8 @@ export default class DashboardStore {
lastModifyTime: now,
},
data: {
source: 'context dataset', // TODO: get name from data source
source: 'context dataset', // TODO: [fix] get name from data source
// kyusho, 4 weeks ago (October 31st, 2022 8:51 PM)
filters: [],
},
cards: [],
Expand Down
3 changes: 2 additions & 1 deletion packages/rath-client/src/store/megaAutomation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export class MegaAutomationStore {
cloneSpaces.sort((a, b) => {
let cardOfA = 0;
let cardOfB = 0;
// TODO: This is an non-accurate cardinalitity estimate.
// TODO: [fix] This is an non-accurate cardinalitity estimate.
// Hao Chen, 11 months ago (January 1st, 2022 1:27 PM)
// should get the correct number from OLAP query.
// but it cost time.(need a discussion.)
for (let dim of a.dimensions) {
Expand Down
3 changes: 2 additions & 1 deletion packages/rath-client/src/utils/deepcopy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// todo replace the deepcopy with a safe and faster one.
// TODO: [fix] replace the deepcopy with a safe and faster one.
// ObservedObserver, 3 years ago (October 11th, 2019 1:04 PM)
export default function deepcopy<T = any>(dataSource: T): T {
return JSON.parse(JSON.stringify(dataSource))
}
Expand Down
2 changes: 1 addition & 1 deletion packages/rath-client/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function isASCII(str: string) {

function inferAnalyticType(dataSource: IRow[], fid: string): IAnalyticType {
return dataSource.every((row) => {
// TODO: 推断逻辑抽象一下
// TODO: [refactor] 推断逻辑抽象一下
return !isNaN(Number(row[fid])) || row[fid] === undefined;
})
? 'measure'
Expand Down
3 changes: 2 additions & 1 deletion packages/rath-client/src/utils/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export function transNumber(num: any): number | null {
return Number(num)
}

// todo: Sync time rules in visual-insights
// todo: [refactor] Sync time rules in visual-insights
// Hao Chen, 10 months ago (January 25th, 2022 10:22 PM)
// const TIME_RULES: RegExp[] = [
// /^[0-9]{2,4}[-/][0-9]{1,2}([-/][0-9]{1,2})?$/, // YYYY-MM-DD
// /^[0-9]{1,2}[-/][0-9]{1,2}[-/][0-9]{2,4}$/, // MM-DD-YYYY
Expand Down
9 changes: 6 additions & 3 deletions packages/rath-client/src/workers/engine/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ export class RathEngine extends VIEngine {
}
public async scanDetail(viewSpace: ViewSpace) {
const context = this;
// @ts-ignore TODO: FIX this in visual insights
// @ts-ignore TODO: [fix] FIX this in visual insights
// Hao Chen, 14 months ago (September 28th, 2021 11:18 PM)
const { cube, fieldDictonary } = context;
const { dimensions, measures } = viewSpace;
const insightSpaces: IInsightSpace[] = []
Expand Down Expand Up @@ -230,7 +231,8 @@ export class RathEngine extends VIEngine {

// for (let mea of viewSpace.measures) {
// const distList = localDist.map(r => ({
// // TODO: 讨论是否应当直接使用count
// // TODO: [discuss]讨论是否应当直接使用count
// Hao Chen, 11 months ago (December 26th, 2021 2:35 AM)
// // props: 节省计算量
// // cons: 强依赖于cube必须去计算count
// ...r,
Expand Down Expand Up @@ -443,7 +445,8 @@ export class RathEngine extends VIEngine {
}
const totalCount = fieldDictonary.get(mea)!.features.size;
const distList = localDist.map(r => ({
// TODO: 讨论是否应当直接使用count
// TODO: [discuss] 讨论是否应当直接使用count
// Hao Chen, 9 months ago (March 14th, 2022 7:03 PM)
// props: 节省计算量
// cons: 强依赖于cube必须去计算count
freq: r[mea].reduce((total: number, value: number) => total + value, 0),
Expand Down
3 changes: 2 additions & 1 deletion packages/rath-client/src/workers/engine/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { ICol, IFilter, IRow } from "../../interfaces";

/**
* @deprecated
* TODO: remove this
* TODO: [refactor] remove this
* kyusho, 7 days ago (November 22nd, 2022 11:46 PM)
*/
export function applyFilters (dataSource: IRow[],
extFields: Map<string, ICol<any>>,
Expand Down
3 changes: 2 additions & 1 deletion packages/rath-client/src/workers/engine/metaInfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export function inferMeta (props: { dataSource: IRow[]; fields: IMuteFieldBase[]
semanticType = semanticType === 'quantitative' ? 'ordinal' : semanticType
}
const disable: boolean = field.disable === '?' ? inferDisable(dataSource, field.fid) : Boolean(field.disable);
// TODO: 临时处理逻辑。后续可视化部分扩展好了,这部分要消除掉。(使用dist图表就可以解决)
// TODO: [fix] 临时处理逻辑。后续可视化部分扩展好了,这部分要消除掉。(使用dist图表就可以解决)
// Hao Chen, 9 months ago (March 8th, 2022 7:29 PM)
if (analyticType === 'measure' && semanticType === 'ordinal') {
semanticType = 'quantitative'
}
Expand Down
3 changes: 1 addition & 2 deletions packages/rath-client/src/workers/fieldsSummary.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ const fieldSummary = (e) => {
}
}
try {
// todo:
// should field type changed after re-group ?
// TODO: [discuss] should field type changed after re-group ?
// pros: it generates a new fields. we should regard the new fields as a independent one without care about the original one's property.
// cons: there might be a difference between nominal and ordinal field for data mining. some quantitative field become a ordinal one instead of nominal one. how to judge this case?
// quantitative -> ordinal ? if quantitative, vis can use linear color scale or opacity, else use norminal color scale which lost info (can be fixed for ordinal in future)
Expand Down
6 changes: 4 additions & 2 deletions packages/rath-client/src/workers/loa/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class TestCore extends NextVICore {
fields: [...viewFields],
filters: view.filters,
};
// TODO: dfc for multi view wildcards
// TODO: [feat] dfc for multi view wildcards
// jojocys, last week (November 19th, 2022 4:38 PM)
for (let card of viewWildCards) {
const fieldsWithScore: { field: IFieldMeta; score1: number; score2: number }[] = [];
for (let field of fields) {
Expand Down Expand Up @@ -82,7 +83,8 @@ class TestCore extends NextVICore {
score2: totalScore,
});
}
// TODO: 考虑字段的semantic 与 analyticType 都可以作为近邻的相似度评分
// TODO: [feat] 考虑字段的semantic 与 analyticType 都可以作为近邻的相似度评分
// jojocys, last week (November 19th, 2022 4:38 PM)
fieldsWithScore.sort((a, b) => {
if (b.score1 > a.score1) return 1;
if (b.score1 < a.score1) return -1;
Expand Down
3 changes: 2 additions & 1 deletion packages/vega-scenegraph/src/bound/boundStroke.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default function(bounds, item, miter) {
}

function miterAdjustment(item, strokeWidth) {
// TODO: more sophisticated adjustment? Or miter support in boundContext?
// TODO: [feat] more sophisticated adjustment? Or miter support in boundContext?
// observedobserver, 2 months ago (October 5th, 2022 9:46 PM)
return item.strokeJoin && item.strokeJoin !== 'miter' ? 0 : strokeWidth;
}
1 change: 0 additions & 1 deletion services/causal-service/algorithms/FuncDepTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def __init__(self, dataSource: List[common.IRow], fields: List[common.IFieldMeta
super(FuncDepTest, self).__init__(dataSource=dataSource, fields=fields, params=params)

def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = []):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
d = len(focusedFields)
import itertools, numpy as np
Expand Down
1 change: 0 additions & 1 deletion services/causal-service/algorithms/causallearn/CAM_UV.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def constructBgKnowledge(self, bgKnowledges: Optional[List[common.BgKnowledge]]
# return self.bk

def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
# common.checkLinearCorr(array)
params.__dict__['cache_path'] = None # '/tmp/causal/pc.json'
Expand Down
1 change: 0 additions & 1 deletion services/causal-service/algorithms/causallearn/CD_NOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def constructBgKnowledge(self, bgKnowledges: Optional[List[common.BgKnowledge]]
return self.bk

def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
# if params.c_indx == '$field':
# if params.c_indx_field not in focusedFields:
# raise f"$field {params.c_indx_field} not existed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def constructGraph(self, bgKnowledges: Optional[List[common.BgKnowledge]] = [],
include_graph[f_ind[bg.src], f_ind[bg.tar]] = True
return super_graph, include_graph
def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
# common.checkLinearCorr(array)
f_ind = {f: i for i, f in enumerate(focusedFields)}
Expand Down
1 change: 0 additions & 1 deletion services/causal-service/algorithms/causallearn/FCI.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def constructBgKnowledge(self, bgKnowledges: Optional[List[common.BgKnowledge]]


def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
# common.checkLinearCorr(array)
print(array, array.min(), array.max())
Expand Down
1 change: 0 additions & 1 deletion services/causal-service/algorithms/causallearn/GES.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def __init__(self, dataSource: List[IRow], fields: List[IFieldMeta], params: Opt
super(GES, self).__init__(dataSource=dataSource, fields=fields, params=params)

def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
common.checkLinearCorr(array)
self.Record = ges(array, score_func=params.score_func, maxP=params.maxP if params.maxP else None)
Expand Down
1 change: 0 additions & 1 deletion services/causal-service/algorithms/causallearn/GIN.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def constructBgKnowledge(self, bgKnowledges: Optional[List[common.BgKnowledge]]
# return self.bk

def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
# common.checkLinearCorr(array)
params.__dict__['cache_path'] = None # '/tmp/causal/pc.json'
Expand Down
1 change: 0 additions & 1 deletion services/causal-service/algorithms/causallearn/GRaSP.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def constructBgKnowledge(self, bgKnowledges: Optional[List[common.BgKnowledge]]
# return self.bk

def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
# common.checkLinearCorr(array)
params.__dict__['cache_path'] = None # '/tmp/causal/pc.json'
Expand Down
1 change: 0 additions & 1 deletion services/causal-service/algorithms/causallearn/PC.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def constructBgKnowledge(self, bgKnowledges: Optional[List[common.BgKnowledge]]
return self.bk

def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
# common.checkLinearCorr(array)
print("fields=", self.fields)
Expand Down
1 change: 0 additions & 1 deletion services/causal-service/algorithms/causallearn/RCD.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def constructBgKnowledge(self, bgKnowledges: Optional[List[common.BgKnowledge]]
# return self.bk

def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
# common.checkLinearCorr(array)
params.__dict__['cache_path'] = None # '/tmp/causal/pc.json'
Expand Down
5 changes: 2 additions & 3 deletions services/causal-service/algorithms/causallearn/XLearner.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def toposort(adj) -> List[int]:
G_fd: Gfd中的点集,原图编号
"""
for dep in functional_dependencies:
if len(dep.params) == 1: # TODO: dep.fid depends only on dep.params[0]:
if len(dep.params) == 1: # TODO: [feat] dep.fid depends only on dep.params[0]:
param, f = dep.params[0].fid, dep.fid
u, v = f_ind[dep.params[0].fid], f_ind[dep.fid]
src, dest = NodeId.get(u, None), NodeId.get(v, None)
Expand All @@ -139,7 +139,7 @@ def toposort(adj) -> List[int]:
adj[src].add(dest)
anc[dest].add(src)
else:
# TODO: should be treated the same as bgKnowledge
# TODO: [feat] should be treated the same as bgKnowledge
pass
topo = toposort(adj)

Expand Down Expand Up @@ -337,7 +337,6 @@ def constructBgKnowledge(self, bgKnowledges: Optional[List[common.BgKnowledge]]


def calc(self, params: Optional[ParamType] = ParamType(), focusedFields: List[str] = [], bgKnowledges: Optional[List[common.BgKnowledge]] = [], funcDeps: common.IFunctionalDep = [], **kwargs):
# TODO: new knowledges
array = self.selectArray(focusedFields=focusedFields, params=params)
# common.checkLinearCorr(array)
print(array, array.min(), array.max())
Expand Down

1 comment on commit fe41774

@vercel
Copy link

@vercel vercel bot commented on fe41774 Nov 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.