Skip to content
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
4 changes: 3 additions & 1 deletion dist/js/PropertyFactory.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { MetaPropertyHolderSchema, PropertyHolderSchema, ProtoPropertyHolderSchema } from "@mat3ra/esse/dist/js/types";
import type MetaProperty from "./MetaProperty";
import FormationEnergyContributionsProperty from "./properties/array-of-objects/FormationEnergyContributionsProperty";
import AveragePotentialProfileProperty from "./properties/non-scalar/AveragePotentialProfileProperty";
import BandGapsProperty from "./properties/non-scalar/BandGapsProperty";
import BandStructureProperty from "./properties/non-scalar/BandStructureProperty";
Expand Down Expand Up @@ -52,8 +53,9 @@ export default class PropertyFactory {
static getMultipleResultsPropertyNames(): PropertyName[];
static getScalarPropertyNames(): PropertyName[];
static getNonScalarPropertyNames(): PropertyName[];
static getArrayOfObjectsPropertyNames(): PropertyName[];
private static filterPropertyNames;
static createProperty(config: AnyProperty): AveragePotentialProfileProperty | BandGapsProperty | BandStructureProperty | ChargeDensityProfileProperty | ConvergenceElectronicProperty | ConvergenceIonicProperty | DensityOfStatesProperty | DielectricTensorProperty | FileContentProperty | FinalStructureProperty | HubbardUProperty | HubbardVNNProperty | HubbardVProperty | IsRelaxedProperty | JupyterNotebookEndpointProperty | PhononDispersionsProperty | PhononDOSProperty | PotentialProfileProperty | ReactionEnergyProfileProperty | WavefunctionAmplitudeProperty | WorkflowProperty | TotalEnergyContributionsProperty | FermiEnergyProperty | FormationEnergyProperty | HOMOEnergyProperty | IonizationPotentialElementalProperty | LUMOEnergyProperty | PressureProperty | ReactionEnergyBarrierProperty | SurfaceEnergyProperty | ThermalCorrectionToEnergyProperty | ThermalCorrectionToEnthalpyProperty | TotalEnergyProperty | TotalForcesProperty | ValenceBandOffsetProperty | ZeroPointEnergyProperty | AtomicForcesProperty | MagneticMomentsProperty | StressTensorProperty;
static createProperty(config: AnyProperty): FormationEnergyContributionsProperty | AveragePotentialProfileProperty | BandGapsProperty | BandStructureProperty | ChargeDensityProfileProperty | ConvergenceElectronicProperty | ConvergenceIonicProperty | DensityOfStatesProperty | DielectricTensorProperty | FileContentProperty | FinalStructureProperty | HubbardUProperty | HubbardVNNProperty | HubbardVProperty | IsRelaxedProperty | JupyterNotebookEndpointProperty | PhononDispersionsProperty | PhononDOSProperty | PotentialProfileProperty | ReactionEnergyProfileProperty | WavefunctionAmplitudeProperty | WorkflowProperty | TotalEnergyContributionsProperty | FermiEnergyProperty | FormationEnergyProperty | HOMOEnergyProperty | IonizationPotentialElementalProperty | LUMOEnergyProperty | PressureProperty | ReactionEnergyBarrierProperty | SurfaceEnergyProperty | ThermalCorrectionToEnergyProperty | ThermalCorrectionToEnthalpyProperty | TotalEnergyProperty | TotalForcesProperty | ValenceBandOffsetProperty | ZeroPointEnergyProperty | AtomicForcesProperty | MagneticMomentsProperty | StressTensorProperty;
static createMetaProperty(config: AnyMetaProperty): MetaProperty;
static createProtoProperty(config: AnyProtoProperty): AtomicConstraintsProperty | BoundaryConditionsProperty;
}
Expand Down
7 changes: 7 additions & 0 deletions dist/js/PropertyFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const PseudopotentialMetaProperty_1 = __importDefault(require("./meta_properties/PseudopotentialMetaProperty"));
const FormationEnergyContributionsProperty_1 = __importDefault(require("./properties/array-of-objects/FormationEnergyContributionsProperty"));
const AveragePotentialProfileProperty_1 = __importDefault(require("./properties/non-scalar/AveragePotentialProfileProperty"));
const BandGapsProperty_1 = __importDefault(require("./properties/non-scalar/BandGapsProperty"));
const BandStructureProperty_1 = __importDefault(require("./properties/non-scalar/BandStructureProperty"));
Expand Down Expand Up @@ -61,6 +62,7 @@ const PROPERTY_CLASS_MAP = {
[ThermalCorrectionToEnthalpyProperty_1.default.propertyName]: ThermalCorrectionToEnthalpyProperty_1.default,
[ZeroPointEnergyProperty_1.default.propertyName]: ZeroPointEnergyProperty_1.default,
[TotalEnergyContributionsProperty_1.default.propertyName]: TotalEnergyContributionsProperty_1.default,
[FormationEnergyContributionsProperty_1.default.propertyName]: FormationEnergyContributionsProperty_1.default,
[AtomicForcesProperty_1.default.propertyName]: AtomicForcesProperty_1.default,
[StressTensorProperty_1.default.propertyName]: StressTensorProperty_1.default,
[DensityOfStatesProperty_1.default.propertyName]: DensityOfStatesProperty_1.default,
Expand Down Expand Up @@ -120,6 +122,11 @@ class PropertyFactory {
return PropertyClass.propertyType === settings_1.PropertyType.non_scalar;
});
}
static getArrayOfObjectsPropertyNames() {
return this.filterPropertyNames((PropertyClass) => {
return (PropertyClass.propertyType === settings_1.PropertyType.array_of_objects);
});
}
static filterPropertyNames(filterFn) {
const properties = Object.values({
...PROPERTY_CLASS_MAP,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
import type { FormationEnergyContributionsPropertySchema } from "@mat3ra/esse/dist/js/types";
export type FormationEnergyContributionsPropertySchemaMixin = Omit<FormationEnergyContributionsPropertySchema, "_id" | "slug" | "systemName" | "schemaVersion">;
export type FormationEnergyContributionsPropertyInMemoryEntity = InMemoryEntity & FormationEnergyContributionsPropertySchemaMixin;
export declare function formationEnergyContributionsPropertySchemaMixin<T extends InMemoryEntity>(item: InMemoryEntity): asserts item is T & FormationEnergyContributionsPropertySchemaMixin;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formationEnergyContributionsPropertySchemaMixin = formationEnergyContributionsPropertySchemaMixin;
function formationEnergyContributionsPropertySchemaMixin(item) {
// @ts-expect-error
const properties = {
get name() {
return this.requiredProp("name");
},
set name(value) {
this.setProp("name", value);
},
get values() {
return this.requiredProp("values");
},
set values(value) {
this.setProp("values", value);
},
};
Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
}
1 change: 1 addition & 0 deletions dist/js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export { PropertyName, PropertyType } from "./settings";
export { default as Property } from "./Property";
export { default as MetaProperty } from "./MetaProperty";
export { default as PseudopotentialMetaProperty } from "./meta_properties/PseudopotentialMetaProperty";
export { default as FormationEnergyContributionsProperty } from "./properties/array-of-objects/FormationEnergyContributionsProperty";
export { default as FinalStructureProperty } from "./properties/non-scalar/FinalStructureProperty";
export { default as BandGapsProperty } from "./properties/non-scalar/BandGapsProperty";
export { default as IsRelaxedProperty } from "./properties/non-scalar/IsRelaxedProperty";
Expand Down
4 changes: 3 additions & 1 deletion dist/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProtoPropertyHolder = exports.MetaPropertyHolder = exports.PropertyHolder = exports.metaPropertyHolderMixin = exports.propertyHolderMixin = exports.protoPropertyHolderMixin = exports.ReactionEnergyProfileProperty = exports.WavefunctionAmplitudeProperty = exports.PotentialProfileProperty = exports.ChargeDensityProfileProperty = exports.BandStructureProperty = exports.ThermalCorrectionToEnthalpyProperty = exports.ThermalCorrectionToEnergyProperty = exports.LUMOEnergyProperty = exports.HOMOEnergyProperty = exports.TotalEnergyProperty = exports.SurfaceEnergyProperty = exports.FormationEnergyProperty = exports.ReactionEnergyBarrierProperty = exports.PressureProperty = exports.IsRelaxedProperty = exports.BandGapsProperty = exports.FinalStructureProperty = exports.PseudopotentialMetaProperty = exports.MetaProperty = exports.Property = exports.PropertyType = exports.PropertyName = exports.PropertyFactory = void 0;
exports.ProtoPropertyHolder = exports.MetaPropertyHolder = exports.PropertyHolder = exports.metaPropertyHolderMixin = exports.propertyHolderMixin = exports.protoPropertyHolderMixin = exports.ReactionEnergyProfileProperty = exports.WavefunctionAmplitudeProperty = exports.PotentialProfileProperty = exports.ChargeDensityProfileProperty = exports.BandStructureProperty = exports.ThermalCorrectionToEnthalpyProperty = exports.ThermalCorrectionToEnergyProperty = exports.LUMOEnergyProperty = exports.HOMOEnergyProperty = exports.TotalEnergyProperty = exports.SurfaceEnergyProperty = exports.FormationEnergyProperty = exports.ReactionEnergyBarrierProperty = exports.PressureProperty = exports.IsRelaxedProperty = exports.BandGapsProperty = exports.FinalStructureProperty = exports.FormationEnergyContributionsProperty = exports.PseudopotentialMetaProperty = exports.MetaProperty = exports.Property = exports.PropertyType = exports.PropertyName = exports.PropertyFactory = void 0;
var PropertyFactory_1 = require("./PropertyFactory");
Object.defineProperty(exports, "PropertyFactory", { enumerable: true, get: function () { return __importDefault(PropertyFactory_1).default; } });
var settings_1 = require("./settings");
Expand All @@ -29,6 +29,8 @@ var MetaProperty_1 = require("./MetaProperty");
Object.defineProperty(exports, "MetaProperty", { enumerable: true, get: function () { return __importDefault(MetaProperty_1).default; } });
var PseudopotentialMetaProperty_1 = require("./meta_properties/PseudopotentialMetaProperty");
Object.defineProperty(exports, "PseudopotentialMetaProperty", { enumerable: true, get: function () { return __importDefault(PseudopotentialMetaProperty_1).default; } });
var FormationEnergyContributionsProperty_1 = require("./properties/array-of-objects/FormationEnergyContributionsProperty");
Object.defineProperty(exports, "FormationEnergyContributionsProperty", { enumerable: true, get: function () { return __importDefault(FormationEnergyContributionsProperty_1).default; } });
var FinalStructureProperty_1 = require("./properties/non-scalar/FinalStructureProperty");
Object.defineProperty(exports, "FinalStructureProperty", { enumerable: true, get: function () { return __importDefault(FinalStructureProperty_1).default; } });
var BandGapsProperty_1 = require("./properties/non-scalar/BandGapsProperty");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
import type { FormationEnergyContributionsPropertySchema } from "@mat3ra/esse/dist/js/types";
import { FormationEnergyContributionsPropertySchemaMixin } from "../../generated/FormationEnergyContributionsPropertySchemaMixin";
import Property from "../../Property";
import { PropertyName, PropertyType } from "../../settings";
type Schema = FormationEnergyContributionsPropertySchema;
type Base = typeof Property<Schema> & Constructor<FormationEnergyContributionsPropertySchemaMixin>;
declare const PropertyBase: Base;
export default class FormationEnergyContributionsProperty extends PropertyBase implements Schema {
static readonly propertyType = PropertyType.array_of_objects;
static readonly propertyName = PropertyName.formation_energy_contributions;
constructor(config: Omit<Schema, "name">);
}
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const FormationEnergyContributionsPropertySchemaMixin_1 = require("../../generated/FormationEnergyContributionsPropertySchemaMixin");
const Property_1 = __importDefault(require("../../Property"));
const settings_1 = require("../../settings");
const PropertyBase = Property_1.default;
class FormationEnergyContributionsProperty extends PropertyBase {
constructor(config) {
super({ ...config, name: FormationEnergyContributionsProperty.propertyName });
}
}
FormationEnergyContributionsProperty.propertyType = settings_1.PropertyType.array_of_objects;
FormationEnergyContributionsProperty.propertyName = settings_1.PropertyName.formation_energy_contributions;
exports.default = FormationEnergyContributionsProperty;
(0, FormationEnergyContributionsPropertySchemaMixin_1.formationEnergyContributionsPropertySchemaMixin)(FormationEnergyContributionsProperty.prototype);
4 changes: 3 additions & 1 deletion dist/js/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export declare enum PropertyType {
scalar = "scalar",
non_scalar = "non-scalar",
tensor = "tensor",
object = "object"
object = "object",
array_of_objects = "array-of-objects"
}
export declare enum PropertyName {
pressure = "pressure",
Expand All @@ -23,6 +24,7 @@ export declare enum PropertyName {
thermal_correction_to_energy = "thermal_correction_to_energy",
thermal_correction_to_enthalpy = "thermal_correction_to_enthalpy",
total_energy_contributions = "total_energy_contributions",
formation_energy_contributions = "formation_energy_contributions",
atomic_forces = "atomic_forces",
atomic_constraints = "atomic_constraints",
stress_tensor = "stress_tensor",
Expand Down
2 changes: 2 additions & 0 deletions dist/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var PropertyType;
// non-scalar subtypes
PropertyType["tensor"] = "tensor";
PropertyType["object"] = "object";
PropertyType["array_of_objects"] = "array-of-objects";
})(PropertyType || (exports.PropertyType = PropertyType = {}));
var PropertyName;
(function (PropertyName) {
Expand All @@ -31,6 +32,7 @@ var PropertyName;
PropertyName["thermal_correction_to_energy"] = "thermal_correction_to_energy";
PropertyName["thermal_correction_to_enthalpy"] = "thermal_correction_to_enthalpy";
PropertyName["total_energy_contributions"] = "total_energy_contributions";
PropertyName["formation_energy_contributions"] = "formation_energy_contributions";
PropertyName["atomic_forces"] = "atomic_forces";
PropertyName["atomic_constraints"] = "atomic_constraints";
PropertyName["stress_tensor"] = "stress_tensor";
Expand Down
Loading
Loading