Skip to content

Commit f170bed

Browse files
committed
update: change madeMaterial to Material
1 parent f72aa21 commit f170bed

20 files changed

+177
-453
lines changed

Diff for: dist/MaterialsDesigner.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,7 @@ class MaterialsDesigner extends mix(React.Component).with(FullscreenComponentMix
140140
}, className: "materials-designer-source-editor", children: [_jsx(Grid, { item: true, xs: 12, mt: 0.25, children: _jsx(LatticeEditor, { material: this.props.material, onUpdate: this.props.onUpdate }) }), _jsx(Grid, { item: true, xs: 12, mt: 0.25, children: _jsx(BasisEditor, { material: this.props.material, onUpdate: this.props.onUpdate }) })] })), isVisibleThreeDEditorFullscreen && (
141141
// eslint-disable-next-line react/jsx-props-no-spreading
142142
_jsx(Grid, { item: true, ...gridConfig[3], mt: 0.25, children: _jsx(ThreeDEditorFullscreen, { editable: true, material: this.props.material, isConventionalCellShown: this.props.isConventionalCellShown, boundaryConditions: this.props.material.boundaryConditions, onUpdate: (material) => {
143-
// convert made material to MD material and re-set metadata
144-
const newMaterial = Material.createFromMadeMaterial(material);
145-
newMaterial.metadata =
146-
this.props.material.metadata || {};
143+
const newMaterial = Material.fromMadeMaterial(material, this.props.material.metadata);
147144
this.props.onUpdate(newMaterial);
148145
} }) })), this.state.isVisibleJupyterLiteSessionDrawer && (_jsx(JupyterLiteSessionDrawer, { materials: this.props.materials, show: this.state.isVisibleJupyterLiteSessionDrawer, onMaterialsUpdate: (...args) => {
149146
this.props.onAdd(...args);
Original file line numberDiff line numberDiff line change
@@ -1,205 +1,15 @@
1-
import { Made } from "@mat3ra/made";
1+
import { Material as MDMaterial } from "../../../../material";
22
import BaseJupyterLiteSessionComponent, { BaseJupyterLiteProps } from "../../../include/jupyterlite/BaseJupyterLiteComponent";
33
interface JupyterLiteTransformationDialogState {
4-
selectedMaterials: Made.Material[];
5-
newMaterials: Made.Material[];
4+
selectedMaterials: MDMaterial[];
5+
newMaterials: MDMaterial[];
66
}
77
declare class JupyterLiteTransformationDialog extends BaseJupyterLiteSessionComponent<BaseJupyterLiteProps, JupyterLiteTransformationDialogState> {
88
constructor(props: BaseJupyterLiteProps);
99
componentDidUpdate(prevProps: BaseJupyterLiteProps, prevState: JupyterLiteTransformationDialogState): void;
1010
handleSubmit: () => void;
11-
setMaterials: (newMaterials: Made.Material[]) => void;
12-
getMaterialsToUse: () => ({
13-
_json: import("@mat3ra/made/dist/js/material").MaterialSchemaJSON;
14-
toJSON(): import("@mat3ra/made/dist/js/types").MaterialJSON;
15-
src: import("@mat3ra/esse/dist/js/types").FileSourceSchema | undefined;
16-
updateFormula(): void;
17-
isNonPeriodic: boolean;
18-
getDerivedPropertyByName(name: string): {
19-
name?: "volume" | undefined;
20-
units?: "angstrom^3" | undefined;
21-
value: number;
22-
} | {
23-
name?: "density" | undefined;
24-
units?: "g/cm^3" | undefined;
25-
value: number;
26-
} | {
27-
pointGroupSymbol?: string | undefined;
28-
spaceGroupSymbol?: string | undefined;
29-
tolerance?: {
30-
units?: "angstrom" | undefined;
31-
value: number;
32-
} | undefined;
33-
name?: "symmetry" | undefined;
34-
} | {
35-
name?: "elemental_ratio" | undefined;
36-
value: number;
37-
element?: string | undefined;
38-
} | {
39-
name?: "p-norm" | undefined;
40-
degree?: number | undefined;
41-
value: number;
42-
} | {
43-
name?: "inchi" | undefined;
44-
value: string;
45-
} | {
46-
name?: "inchi_key" | undefined;
47-
value: string;
48-
} | undefined;
49-
getDerivedProperties(): import("@mat3ra/esse/dist/js/types").DerivedPropertiesSchema;
50-
readonly formula: string;
51-
readonly unitCellFormula: string;
52-
unsetFileProps(): void;
53-
setBasis(textOrObject: string | import("@mat3ra/made/dist/js/parsers/xyz").BasisConfig, format?: string | undefined, unitz?: string | undefined): void;
54-
setBasisConstraints(constraints: import("@mat3ra/made/dist/js/constraints/constraints").Constraint[]): void;
55-
readonly basis: import("@mat3ra/made/dist/js/parsers/xyz").BasisConfig;
56-
readonly Basis: import("@mat3ra/made/dist/js/basis/constrained_basis").ConstrainedBasis;
57-
readonly uniqueElements: string[];
58-
lattice: import("@mat3ra/made/dist/js/lattice/lattice_vectors").BravaisConfigProps | undefined;
59-
readonly Lattice: Made.Lattice;
60-
getInchiStringForHash(): string;
61-
calculateHash(salt?: string | undefined, isScaled?: boolean | undefined, bypassNonPeriodicCheck?: boolean | undefined): string;
62-
hash: string;
63-
readonly scaledHash: string;
64-
toCrystal(): void;
65-
toCartesian(): void;
66-
getBasisAsXyz(fractional?: boolean | undefined): string;
67-
getAsQEFormat(): string;
68-
getAsPOSCAR(ignoreOriginal?: boolean | undefined, omitConstraints?: boolean | undefined): string;
69-
getACopyWithConventionalCell(): any;
70-
getConsistencyChecks(): import("@mat3ra/esse/dist/js/types").ConsistencyCheck[];
71-
getBasisConsistencyChecks(): import("@mat3ra/esse/dist/js/types").ConsistencyCheck[];
72-
consistencyChecks: object[];
73-
addConsistencyChecks(array: object[]): void;
74-
prop: {
75-
<T = undefined>(name: string, defaultValue: T): T;
76-
<T_1 = undefined>(name: string): T_1 | undefined;
77-
} & {
78-
<T_2 = undefined>(name: string, defaultValue: T_2): T_2;
79-
<T_1_1 = undefined>(name: string): T_1_1 | undefined;
80-
} & {
81-
<T_3 = undefined>(name: string, defaultValue: T_3): T_3;
82-
<T_1_2 = undefined>(name: string): T_1_2 | undefined;
83-
} & {
84-
<T_4 = undefined>(name: string, defaultValue: T_4): T_4;
85-
<T_1_3 = undefined>(name: string): T_1_3 | undefined;
86-
} & {
87-
<T_5 = undefined>(name: string, defaultValue: T_5): T_5;
88-
<T_6 = undefined>(name: string): T_6 | undefined;
89-
};
90-
setProp: ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void);
91-
unsetProp: ((name: string) => void) & ((name: string) => void) & ((name: string) => void) & ((name: string) => void) & ((name: string) => void);
92-
setProps: ((json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined) => any) & ((json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined) => any) & ((json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined) => any) & ((json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined) => any) & ((json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined) => any);
93-
toJSONSafe: ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject);
94-
toJSONQuick: ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((exclude?: string[] | undefined) => import("@mat3ra/esse/dist/js/esse/types").AnyObject);
95-
clone: ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any);
96-
validate: (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
97-
clean: ((config: import("@mat3ra/esse/dist/js/esse/types").AnyObject) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((config: import("@mat3ra/esse/dist/js/esse/types").AnyObject) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((config: import("@mat3ra/esse/dist/js/esse/types").AnyObject) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((config: import("@mat3ra/esse/dist/js/esse/types").AnyObject) => import("@mat3ra/esse/dist/js/esse/types").AnyObject) & ((config: import("@mat3ra/esse/dist/js/esse/types").AnyObject) => import("@mat3ra/esse/dist/js/esse/types").AnyObject);
98-
isValid: (() => boolean) & (() => boolean) & (() => boolean) & (() => boolean) & (() => boolean);
99-
id: string;
100-
readonly cls: string;
101-
getClsName: (() => string) & (() => string) & (() => string) & (() => string) & (() => string);
102-
readonly slug: string;
103-
readonly isSystemEntity: boolean;
104-
getAsEntityReference: ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema);
105-
getEntityByName: ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity);
106-
metadata: object;
107-
updateMetadata(object: object): void;
108-
name: string;
109-
setName(name: string): void;
110-
readonly isDefault: boolean;
111-
} & {
112-
consistencyChecks: object[];
113-
addConsistencyChecks(array: object[]): void;
114-
_json: import("@mat3ra/esse/dist/js/esse/types").AnyObject;
115-
prop<T_7 = undefined>(name: string, defaultValue: T_7): T_7;
116-
prop<T_1_4 = undefined>(name: string): T_1_4 | undefined;
117-
setProp(name: string, value: unknown): void;
118-
unsetProp(name: string): void;
119-
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined): any;
120-
toJSON(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
121-
toJSONSafe(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
122-
toJSONQuick(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
123-
clone(extraContext?: object | undefined): any;
124-
validate(): void;
125-
clean(config: import("@mat3ra/esse/dist/js/esse/types").AnyObject): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
126-
isValid(): boolean;
127-
id: string;
128-
readonly cls: string;
129-
getClsName(): string;
130-
readonly slug: string;
131-
readonly isSystemEntity: boolean;
132-
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/dist/js/types").EntityReferenceSchema;
133-
getEntityByName(entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string): import("@mat3ra/code/dist/js/entity").InMemoryEntity;
134-
} & {
135-
metadata: object;
136-
updateMetadata(object: object): void;
137-
_json: import("@mat3ra/esse/dist/js/esse/types").AnyObject;
138-
prop<T_2_1 = undefined>(name: string, defaultValue: T_2_1): T_2_1;
139-
prop<T_1_1_1 = undefined>(name: string): T_1_1_1 | undefined;
140-
setProp(name: string, value: unknown): void;
141-
unsetProp(name: string): void;
142-
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined): any;
143-
toJSON(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
144-
toJSONSafe(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
145-
toJSONQuick(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
146-
clone(extraContext?: object | undefined): any;
147-
validate(): void;
148-
clean(config: import("@mat3ra/esse/dist/js/esse/types").AnyObject): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
149-
isValid(): boolean;
150-
id: string;
151-
readonly cls: string;
152-
getClsName(): string;
153-
readonly slug: string;
154-
readonly isSystemEntity: boolean;
155-
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/dist/js/types").EntityReferenceSchema;
156-
getEntityByName(entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string): import("@mat3ra/code/dist/js/entity").InMemoryEntity;
157-
} & {
158-
name: string;
159-
setName(name: string): void;
160-
_json: import("@mat3ra/esse/dist/js/esse/types").AnyObject;
161-
prop<T_3_1 = undefined>(name: string, defaultValue: T_3_1): T_3_1;
162-
prop<T_1_2_1 = undefined>(name: string): T_1_2_1 | undefined;
163-
setProp(name: string, value: unknown): void;
164-
unsetProp(name: string): void;
165-
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined): any;
166-
toJSON(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
167-
toJSONSafe(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
168-
toJSONQuick(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
169-
clone(extraContext?: object | undefined): any;
170-
validate(): void;
171-
clean(config: import("@mat3ra/esse/dist/js/esse/types").AnyObject): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
172-
isValid(): boolean;
173-
id: string;
174-
readonly cls: string;
175-
getClsName(): string;
176-
readonly slug: string;
177-
readonly isSystemEntity: boolean;
178-
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/dist/js/types").EntityReferenceSchema;
179-
getEntityByName(entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string): import("@mat3ra/code/dist/js/entity").InMemoryEntity;
180-
} & {
181-
readonly isDefault: boolean;
182-
_json: import("@mat3ra/esse/dist/js/esse/types").AnyObject;
183-
prop<T_4_1 = undefined>(name: string, defaultValue: T_4_1): T_4_1;
184-
prop<T_1_3_1 = undefined>(name: string): T_1_3_1 | undefined;
185-
setProp(name: string, value: unknown): void;
186-
unsetProp(name: string): void;
187-
setProps(json?: import("@mat3ra/esse/dist/js/esse/types").AnyObject | undefined): any;
188-
toJSON(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
189-
toJSONSafe(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
190-
toJSONQuick(exclude?: string[] | undefined): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
191-
clone(extraContext?: object | undefined): any;
192-
validate(): void;
193-
clean(config: import("@mat3ra/esse/dist/js/esse/types").AnyObject): import("@mat3ra/esse/dist/js/esse/types").AnyObject;
194-
isValid(): boolean;
195-
id: string;
196-
readonly cls: string;
197-
getClsName(): string;
198-
readonly slug: string;
199-
readonly isSystemEntity: boolean;
200-
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/dist/js/types").EntityReferenceSchema;
201-
getEntityByName(entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string): import("@mat3ra/code/dist/js/entity").InMemoryEntity;
202-
} & import("@mat3ra/code/dist/js/entity").InMemoryEntity)[];
11+
setMaterials: (newMaterials: MDMaterial[]) => void;
12+
getMaterialsToUse: () => MDMaterial[];
20313
render(): import("react/jsx-runtime").JSX.Element;
20414
}
20515
export default JupyterLiteTransformationDialog;

Diff for: dist/components/3d_editor/advanced_geometry/python_transformation/MaterialsSelector.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Made } from "@mat3ra/made";
1+
import { Material as MDMaterial } from "../../../../material";
22
interface MaterialsSelectorProps {
3-
materials: Made.Material[];
4-
selectedMaterials: Made.Material[];
5-
setSelectedMaterials: (selectedMaterials: Made.Material[]) => void;
3+
materials: MDMaterial[];
4+
selectedMaterials: MDMaterial[];
5+
setSelectedMaterials: (selectedMaterials: MDMaterial[]) => void;
66
testId?: string;
77
}
88
declare function MaterialsSelector(props: MaterialsSelectorProps): import("react/jsx-runtime").JSX.Element;

Diff for: dist/components/3d_editor/advanced_geometry/python_transformation/MaterialsSelector.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2+
/* eslint-disable react/jsx-props-no-spreading */
23
import CheckBox from "@mui/icons-material/CheckBox";
34
import CheckBoxOutlineBlank from "@mui/icons-material/CheckBoxOutlineBlank";
45
import Autocomplete from "@mui/material/Autocomplete";

Diff for: dist/components/3d_editor/advanced_geometry/python_transformation/PythonTransformation.d.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { Made } from "@mat3ra/made";
21
import React from "react";
2+
import { Material as MDMaterial } from "../../../../material";
33
import { ExecutionStatus } from "./CodeExecutionControls";
44
import { ExecutionCellState } from "./ExecutionCell";
55
import { Transformation } from "./TransformationSelector";
66
interface PythonTransformationProps {
7-
materials: Made.Material[];
7+
materials: MDMaterial[];
88
show: boolean;
9-
onSubmit: (newMaterials: Made.Material[]) => void;
9+
onSubmit: (newMaterials: MDMaterial[]) => void;
1010
onHide: () => void;
1111
}
1212
interface PythonTransformationState {
13-
materials: Made.Material[];
14-
selectedMaterials: Made.Material[];
15-
newMaterials: Made.Material[];
13+
materials: MDMaterial[];
14+
selectedMaterials: MDMaterial[];
15+
newMaterials: MDMaterial[];
1616
executionStatus: ExecutionStatus;
1717
pyodide: any;
1818
transformation: Transformation | null;

Diff for: dist/components/3d_editor/advanced_geometry/python_transformation/PythonTransformation.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Paper from "@mui/material/Paper";
1212
import Stack from "@mui/material/Stack";
1313
import Typography from "@mui/material/Typography";
1414
import React from "react";
15+
import { Material as MDMaterial } from "../../../../material";
1516
import { theme } from "../../../../settings";
1617
import { exportToDisk } from "../../../../utils/downloader";
1718
import CodeExecutionControls, { ExecutionStatus } from "./CodeExecutionControls";
@@ -93,7 +94,7 @@ class PythonTransformation extends React.Component {
9394
const material = this.mapToObject(m);
9495
// material structure is returned in POSCAR format in python code
9596
const config = Made.parsers.poscar.fromPoscar(material.poscar);
96-
const newMaterial = new Made.Material(config);
97+
const newMaterial = new MDMaterial(config);
9798
return newMaterial;
9899
});
99100
this.setState({ newMaterials, executionStatus: ExecutionStatus.Ready });

0 commit comments

Comments
 (0)