This is an automated email from the ASF dual-hosted git repository.
bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new a532da19d [#877] Format and lint core-model module (#1094)
a532da19d is described below
commit a532da19d598e710353087999e6d53aba8da23c7
Author: Aamir shaikh <[email protected]>
AuthorDate: Mon Jan 16 13:52:05 2023 +0530
[#877] Format and lint core-model module (#1094)
---
ui/.eslintignore | 1 -
ui/.prettierignore | 1 -
ui/src/app/core-model/base/UserErrorMessage.ts | 16 +++++------
ui/src/app/core-model/coco/Annotation.ts | 40 ++++++++++++--------------
ui/src/app/core-model/coco/Category.ts | 26 ++++++++++-------
ui/src/app/core-model/coco/Coco.format.ts | 28 +++++++++---------
ui/src/app/core-model/coco/Image.ts | 16 +++++------
7 files changed, 63 insertions(+), 65 deletions(-)
diff --git a/ui/.eslintignore b/ui/.eslintignore
index df54ff075..4d8829b09 100644
--- a/ui/.eslintignore
+++ b/ui/.eslintignore
@@ -21,7 +21,6 @@ cypress/fixtures/**/*.csv
# Remove these in the future to lint additional modules
# Please also see .prettierignore
-src/app/core-model
src/app/core-services
src/app/core-ui
src/app/CustomMaterial
diff --git a/ui/.prettierignore b/ui/.prettierignore
index 4b0f32f39..0cbcf99f4 100644
--- a/ui/.prettierignore
+++ b/ui/.prettierignore
@@ -21,7 +21,6 @@ cypress/fixtures/**/*.csv
# Remove these in the future to format additional modules
# Please also see .eslintignore
-src/app/core-model
src/app/core-services
src/app/core-ui
src/app/CustomMaterial
diff --git a/ui/src/app/core-model/base/UserErrorMessage.ts
b/ui/src/app/core-model/base/UserErrorMessage.ts
index 2fc7f5c72..56bfc061a 100644
--- a/ui/src/app/core-model/base/UserErrorMessage.ts
+++ b/ui/src/app/core-model/base/UserErrorMessage.ts
@@ -17,13 +17,13 @@
*/
export class UserErrorMessage {
- public title: string;
- public content: string;
- public level: string;
+ public title: string;
+ public content: string;
+ public level: string;
- constructor(title: string, content: string, level = 'error') {
- this.title = title;
- this.content = content;
- this.level = level;
- }
+ constructor(title: string, content: string, level = 'error') {
+ this.title = title;
+ this.content = content;
+ this.level = level;
+ }
}
diff --git a/ui/src/app/core-model/coco/Annotation.ts
b/ui/src/app/core-model/coco/Annotation.ts
index 9a3d779ae..9eefe6d4c 100644
--- a/ui/src/app/core-model/coco/Annotation.ts
+++ b/ui/src/app/core-model/coco/Annotation.ts
@@ -17,27 +17,25 @@
*/
export class Annotation {
- id: number;
- image_id: number;
- category_id: number;
- segmentation: [any]; // RLE or [polygon] -> polygon [[x1,y1,x2,y2,... xn,
yn]]
- area: number;
- bbox: [number, number, number, number]; // [x,y,width,height]
- iscrowd: number; // (iscrowd=0 in which case polygons are used) or a
collection of objects (iscrowd=1 in which case RLE is used)
- brushSize: number [];
+ id: number;
+ image_id: number;
+ category_id: number;
+ segmentation: [any]; // RLE or [polygon] -> polygon [[x1,y1,x2,y2,... xn,
yn]]
+ area: number;
+ bbox: [number, number, number, number]; // [x,y,width,height]
+ iscrowd: number; // (iscrowd=0 in which case polygons are used) or a
collection of objects (iscrowd=1 in which case RLE is used)
+ brushSize: number[];
+ // For UI
+ isSelected = false;
+ isHovered = false;
+ category_name: string;
+ color: string;
+ label_name: string;
- // For UI
- isSelected = false;
- isHovered = false;
- category_name: string;
- color: string;
- label_name: string;
-
- constructor() {
- this.segmentation = undefined;
- this.bbox = undefined;
- this.brushSize = undefined;
- }
-
+ constructor() {
+ this.segmentation = undefined;
+ this.bbox = undefined;
+ this.brushSize = undefined;
+ }
}
diff --git a/ui/src/app/core-model/coco/Category.ts
b/ui/src/app/core-model/coco/Category.ts
index f06677622..1578ed535 100644
--- a/ui/src/app/core-model/coco/Category.ts
+++ b/ui/src/app/core-model/coco/Category.ts
@@ -17,16 +17,20 @@
*/
export class Category {
+ constructor(
+ id: number,
+ name: string,
+ supercategory: string,
+ label_name: string,
+ ) {
+ this.id = id;
+ this.name = name;
+ this.supercategory = supercategory;
+ this.label_name = label_name;
+ }
- constructor(id: number, name: string, supercategory: string, label_name:
string) {
- this.id = id;
- this.name = name;
- this.supercategory = supercategory;
- this.label_name = label_name;
- }
-
- id: number;
- name: string;
- supercategory: string;
- label_name: string;
+ id: number;
+ name: string;
+ supercategory: string;
+ label_name: string;
}
diff --git a/ui/src/app/core-model/coco/Coco.format.ts
b/ui/src/app/core-model/coco/Coco.format.ts
index 7b9da4319..e5d720deb 100644
--- a/ui/src/app/core-model/coco/Coco.format.ts
+++ b/ui/src/app/core-model/coco/Coco.format.ts
@@ -21,20 +21,18 @@ import { Category } from './Category';
import { Image } from './Image';
export class CocoFormat {
+ info: {
+ year: number;
+ version: string;
+ description: string;
+ contributor: string;
+ url: string;
+ date_created: Date;
+ };
+ licenses: [];
+ images: Image[] = [];
+ annotations: Annotation[] = [];
+ categories: Category[] = [];
- info: {
- 'year': number,
- 'version': string,
- 'description': string,
- 'contributor': string,
- 'url': string,
- 'date_created': Date,
- };
- licenses: [];
- images: Image[] = [];
- annotations: Annotation[] = [];
- categories: Category[] = [];
-
- constructor() { }
-
+ constructor() {}
}
diff --git a/ui/src/app/core-model/coco/Image.ts
b/ui/src/app/core-model/coco/Image.ts
index 51aeee395..05bf61a24 100644
--- a/ui/src/app/core-model/coco/Image.ts
+++ b/ui/src/app/core-model/coco/Image.ts
@@ -17,12 +17,12 @@
*/
export class Image {
- id: number;
- width: number;
- height: number;
- file_name: Date;
- license: number;
- flickr_url: Date;
- coco_url: Date;
- date_captured: Date;
+ id: number;
+ width: number;
+ height: number;
+ file_name: Date;
+ license: number;
+ flickr_url: Date;
+ coco_url: Date;
+ date_captured: Date;
}