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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ __pycache__/
*.egg-info/
.coverage
htmlcov/
.python-version

2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npm run transpile
git add dist/
2 changes: 2 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"exclude": [
"tests/**/*",
"src/js/generated/**/*",
"dist/**/*",
"build/**/*",
"**/*.test.ts",
"**/*.spec.ts",
"**/*.d.ts"
Expand Down
18 changes: 18 additions & 0 deletions dist/js/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
export { default as PropertyFactory } from "./PropertyFactory";
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 FinalStructureProperty } from "./properties/non-scalar/FinalStructureProperty";
export { default as BandGapsProperty } from "./properties/non-scalar/BandGapsProperty";
export { default as IsRelaxedProperty } from "./properties/non-scalar/IsRelaxedProperty";
export { default as PressureProperty } from "./properties/scalar/PressureProperty";
export { default as ReactionEnergyBarrierProperty } from "./properties/scalar/ReactionEnergyBarrierProperty";
export { default as SurfaceEnergyProperty } from "./properties/scalar/SurfaceEnergyProperty";
export { default as TotalEnergyProperty } from "./properties/scalar/TotalEnergyProperty";
export { default as BandStructureProperty } from "./properties/non-scalar/BandStructureProperty";
export { default as ChargeDensityProfileProperty } from "./properties/non-scalar/ChargeDensityProfileProperty";
export { default as PotentialProfileProperty } from "./properties/non-scalar/PotentialProfileProperty";
export { default as ReactionEnergyProfileProperty } from "./properties/non-scalar/ReactionEnergyProfileProperty";
export { protoPropertyHolderMixin } from "./holders/mixins/ProtoPropertyHolderMixin";
export { propertyHolderMixin } from "./holders/mixins/PropertyHolderMixin";
export { metaPropertyHolderMixin } from "./holders/mixins/MetaPropertyHolderMixin";
export * from "./types";
52 changes: 50 additions & 2 deletions dist/js/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,60 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PropertyType = exports.PropertyName = exports.PropertyFactory = void 0;
// Add exports here
exports.metaPropertyHolderMixin = exports.propertyHolderMixin = exports.protoPropertyHolderMixin = exports.ReactionEnergyProfileProperty = exports.PotentialProfileProperty = exports.ChargeDensityProfileProperty = exports.BandStructureProperty = exports.TotalEnergyProperty = exports.SurfaceEnergyProperty = exports.ReactionEnergyBarrierProperty = exports.PressureProperty = exports.IsRelaxedProperty = exports.BandGapsProperty = exports.FinalStructureProperty = 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");
Object.defineProperty(exports, "PropertyName", { enumerable: true, get: function () { return settings_1.PropertyName; } });
Object.defineProperty(exports, "PropertyType", { enumerable: true, get: function () { return settings_1.PropertyType; } });
var Property_1 = require("./Property");
Object.defineProperty(exports, "Property", { enumerable: true, get: function () { return __importDefault(Property_1).default; } });
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 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");
Object.defineProperty(exports, "BandGapsProperty", { enumerable: true, get: function () { return __importDefault(BandGapsProperty_1).default; } });
var IsRelaxedProperty_1 = require("./properties/non-scalar/IsRelaxedProperty");
Object.defineProperty(exports, "IsRelaxedProperty", { enumerable: true, get: function () { return __importDefault(IsRelaxedProperty_1).default; } });
var PressureProperty_1 = require("./properties/scalar/PressureProperty");
Object.defineProperty(exports, "PressureProperty", { enumerable: true, get: function () { return __importDefault(PressureProperty_1).default; } });
var ReactionEnergyBarrierProperty_1 = require("./properties/scalar/ReactionEnergyBarrierProperty");
Object.defineProperty(exports, "ReactionEnergyBarrierProperty", { enumerable: true, get: function () { return __importDefault(ReactionEnergyBarrierProperty_1).default; } });
var SurfaceEnergyProperty_1 = require("./properties/scalar/SurfaceEnergyProperty");
Object.defineProperty(exports, "SurfaceEnergyProperty", { enumerable: true, get: function () { return __importDefault(SurfaceEnergyProperty_1).default; } });
var TotalEnergyProperty_1 = require("./properties/scalar/TotalEnergyProperty");
Object.defineProperty(exports, "TotalEnergyProperty", { enumerable: true, get: function () { return __importDefault(TotalEnergyProperty_1).default; } });
var BandStructureProperty_1 = require("./properties/non-scalar/BandStructureProperty");
Object.defineProperty(exports, "BandStructureProperty", { enumerable: true, get: function () { return __importDefault(BandStructureProperty_1).default; } });
var ChargeDensityProfileProperty_1 = require("./properties/non-scalar/ChargeDensityProfileProperty");
Object.defineProperty(exports, "ChargeDensityProfileProperty", { enumerable: true, get: function () { return __importDefault(ChargeDensityProfileProperty_1).default; } });
var PotentialProfileProperty_1 = require("./properties/non-scalar/PotentialProfileProperty");
Object.defineProperty(exports, "PotentialProfileProperty", { enumerable: true, get: function () { return __importDefault(PotentialProfileProperty_1).default; } });
var ReactionEnergyProfileProperty_1 = require("./properties/non-scalar/ReactionEnergyProfileProperty");
Object.defineProperty(exports, "ReactionEnergyProfileProperty", { enumerable: true, get: function () { return __importDefault(ReactionEnergyProfileProperty_1).default; } });
var ProtoPropertyHolderMixin_1 = require("./holders/mixins/ProtoPropertyHolderMixin");
Object.defineProperty(exports, "protoPropertyHolderMixin", { enumerable: true, get: function () { return ProtoPropertyHolderMixin_1.protoPropertyHolderMixin; } });
var PropertyHolderMixin_1 = require("./holders/mixins/PropertyHolderMixin");
Object.defineProperty(exports, "propertyHolderMixin", { enumerable: true, get: function () { return PropertyHolderMixin_1.propertyHolderMixin; } });
var MetaPropertyHolderMixin_1 = require("./holders/mixins/MetaPropertyHolderMixin");
Object.defineProperty(exports, "metaPropertyHolderMixin", { enumerable: true, get: function () { return MetaPropertyHolderMixin_1.metaPropertyHolderMixin; } });
__exportStar(require("./types"), exports);
14 changes: 14 additions & 0 deletions dist/js/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type { PropertySchemaJSON, PropertyRowValue } from "./Property";
export type { PropertyHolderSourceSchema, PropertyHolderMixin, PropertyInMemoryEntity, } from "./holders/mixins/PropertyHolderMixin";
export type { ProtoPropertyHolderMixin, ProtoPropertyInMemoryEntity, } from "./holders/mixins/ProtoPropertyHolderMixin";
export type { ProtoPropertySchemaJSON } from "./holders/mixins/ProtoPropertyHolderMixin";
export type { MetaPropertyHolderMixin, MetaPropertyInMemoryEntity, } from "./holders/mixins/MetaPropertyHolderMixin";
export type { MetaPropertySchemaJSON } from "./holders/mixins/MetaPropertyHolderMixin";
export type { default as AtomicForcesProperty } from "./properties/tensor/AtomicForcesProperty";
export type { default as MagneticMomentsProperty } from "./properties/tensor/MagneticMomentsProperty";
export type { default as StressTensorProperty } from "./properties/tensor/StressTensorProperty";
export type { default as AveragePotentialProfileProperty } from "./properties/non-scalar/AveragePotentialProfileProperty";
export type { default as DensityOfStatesProperty } from "./properties/non-scalar/DensityOfStatesProperty";
export type { default as DielectricTensorProperty } from "./properties/non-scalar/DielectricTensorProperty";
export type { default as PhononDispersionsProperty } from "./properties/non-scalar/PhononDispersionsProperty";
export type { default as PhononDOSProperty } from "./properties/non-scalar/PhononDOSProperty";
2 changes: 2 additions & 0 deletions dist/js/types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@exabyte-io/prode.js",
"name": "@mat3ra/prode",
"version": "0.0.0",
"description": "PROperty DEfinitions",
"scripts": {
Expand All @@ -18,21 +18,32 @@
},
"repository": {
"type": "git",
"url": "https://github.com/Exabyte-io/prode.js.git"
"url": "https://github.com/Exabyte-io/prode.git"
},
"main": "dist/js/index.js",
"types": "dist/js/index.d.ts",
"files": [
"/dist",
"/src/js",
".babelrc",
"tsconfig.json"
],
"exports": {
".": {
"types": "./dist/js/index.d.ts",
"default": "./dist/js/index.js"
},
"./types": {
"types": "./dist/js/types.d.ts",
"default": "./dist/js/types.js"
}
},
"author": "Exabyte Inc.",
"bugs": {
"url": "https://github.com/Exabyte-io/prode.js/issues"
"url": "https://github.com/Exabyte-io/prode/issues"
},
"license": "Apache-2.0",
"homepage": "https://github.com/Exabyte-io/prode.js",
"homepage": "https://github.com/Exabyte-io/prode",
"dependencies": {
"@types/highcharts": "^5.0.44",
"lodash": "^4.17.21"
Expand Down
20 changes: 19 additions & 1 deletion src/js/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// Add exports here
export { default as PropertyFactory } from "./PropertyFactory";
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 FinalStructureProperty } from "./properties/non-scalar/FinalStructureProperty";
export { default as BandGapsProperty } from "./properties/non-scalar/BandGapsProperty";
export { default as IsRelaxedProperty } from "./properties/non-scalar/IsRelaxedProperty";
export { default as PressureProperty } from "./properties/scalar/PressureProperty";
export { default as ReactionEnergyBarrierProperty } from "./properties/scalar/ReactionEnergyBarrierProperty";
export { default as SurfaceEnergyProperty } from "./properties/scalar/SurfaceEnergyProperty";
export { default as TotalEnergyProperty } from "./properties/scalar/TotalEnergyProperty";
export { default as BandStructureProperty } from "./properties/non-scalar/BandStructureProperty";
export { default as ChargeDensityProfileProperty } from "./properties/non-scalar/ChargeDensityProfileProperty";
export { default as PotentialProfileProperty } from "./properties/non-scalar/PotentialProfileProperty";
export { default as ReactionEnergyProfileProperty } from "./properties/non-scalar/ReactionEnergyProfileProperty";
export { protoPropertyHolderMixin } from "./holders/mixins/ProtoPropertyHolderMixin";
export { propertyHolderMixin } from "./holders/mixins/PropertyHolderMixin";
export { metaPropertyHolderMixin } from "./holders/mixins/MetaPropertyHolderMixin";

export * from "./types";
24 changes: 24 additions & 0 deletions src/js/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export type { PropertySchemaJSON, PropertyRowValue } from "./Property";
export type {
PropertyHolderSourceSchema,
PropertyHolderMixin,
PropertyInMemoryEntity,
} from "./holders/mixins/PropertyHolderMixin";
export type {
ProtoPropertyHolderMixin,
ProtoPropertyInMemoryEntity,
} from "./holders/mixins/ProtoPropertyHolderMixin";
export type { ProtoPropertySchemaJSON } from "./holders/mixins/ProtoPropertyHolderMixin";
export type {
MetaPropertyHolderMixin,
MetaPropertyInMemoryEntity,
} from "./holders/mixins/MetaPropertyHolderMixin";
export type { MetaPropertySchemaJSON } from "./holders/mixins/MetaPropertyHolderMixin";
export type { default as AtomicForcesProperty } from "./properties/tensor/AtomicForcesProperty";
export type { default as MagneticMomentsProperty } from "./properties/tensor/MagneticMomentsProperty";
export type { default as StressTensorProperty } from "./properties/tensor/StressTensorProperty";
export type { default as AveragePotentialProfileProperty } from "./properties/non-scalar/AveragePotentialProfileProperty";
export type { default as DensityOfStatesProperty } from "./properties/non-scalar/DensityOfStatesProperty";
export type { default as DielectricTensorProperty } from "./properties/non-scalar/DielectricTensorProperty";
export type { default as PhononDispersionsProperty } from "./properties/non-scalar/PhononDispersionsProperty";
export type { default as PhononDOSProperty } from "./properties/non-scalar/PhononDOSProperty";
20 changes: 20 additions & 0 deletions tests/js/properties/convergence_ionic.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { ConvergenceIonicPropertySchema } from "@mat3ra/esse/dist/js/types";
import { expect } from "chai";

import ConvergenceIonicProperty from "../../../src/js/properties/non-scalar/convergence/ConvergenceIonicProperty";
import { PropertyName, PropertyType } from "../../../src/js/settings";

describe("ConvergenceIonicProperty", () => {
it("should create a convergence ionic property", () => {
const config: Omit<ConvergenceIonicPropertySchema, "name"> = {
units: "eV",
data: [{ energy: -100.5 }, { energy: -100.6 }],
};

const property = new ConvergenceIonicProperty(config);

expect(property).to.be.instanceOf(ConvergenceIonicProperty);
expect(ConvergenceIonicProperty.propertyType).equal(PropertyType.non_scalar);
expect(ConvergenceIonicProperty.propertyName).equal(PropertyName.convergence_ionic);
});
});
27 changes: 27 additions & 0 deletions tests/js/properties/hubbard_u.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { HubbardUParametersPropertySchema } from "@mat3ra/esse/dist/js/types";
import { expect } from "chai";

import HubbardUProperty from "../../../src/js/properties/non-scalar/HubbardUProperty";
import { PropertyName, PropertyType } from "../../../src/js/settings";

describe("HubbardUProperty", () => {
it("should create a hubbard u property with correct constructor, propertyType, and propertyName", () => {
const config: Omit<HubbardUParametersPropertySchema, "name"> = {
units: "eV",
values: [
{
id: 0,
atomicSpecies: "Fe",
orbitalName: "3d",
value: 4.0,
},
],
};

const hubbardUProperty = new HubbardUProperty(config);

expect(hubbardUProperty).to.be.instanceOf(HubbardUProperty);
expect(HubbardUProperty.propertyType).equal(PropertyType.non_scalar);
expect(HubbardUProperty.propertyName).equal(PropertyName.hubbard_u);
});
});
28 changes: 28 additions & 0 deletions tests/js/properties/phonon_dos.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { PhononDensityOfStatesPropertySchema } from "@mat3ra/esse/dist/js/types";
import { expect } from "chai";

import PhononDOSProperty from "../../../src/js/properties/non-scalar/PhononDOSProperty";
import { PropertyName, PropertyType } from "../../../src/js/settings";

describe("PhononDOSProperty", () => {
it("should create a phonon dos property with correct constructor, propertyType, and propertyName", () => {
const config: Omit<PhononDensityOfStatesPropertySchema, "name"> = {
xAxis: {
label: "frequency" as const,
units: "cm-1",
},
yAxis: {
label: "Phonon DOS" as const,
units: "states/cm-1",
},
xDataArray: [0.0, 100.0, 200.0, 300.0],
yDataSeries: [[0.1, 0.2, 0.3, 0.4] as [number, ...number[]]],
};

const phononDOSProperty = new PhononDOSProperty(config);

expect(phononDOSProperty).to.be.instanceOf(PhononDOSProperty);
expect(PhononDOSProperty.propertyType).equal(PropertyType.non_scalar);
expect(PhononDOSProperty.propertyName).equal(PropertyName.phonon_dos);
});
});
23 changes: 23 additions & 0 deletions tests/js/proto_properties/atomic_constraints.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { AtomicConstraintsPropertySchema } from "@mat3ra/esse/dist/js/types";
import { expect } from "chai";

import AtomicConstraintsProperty from "../../../src/js/proto_properties/AtomicConstraintsProperty";
import { PropertyName } from "../../../src/js/settings";

describe("AtomicConstraintsProperty", () => {
it("should create an atomic constraints property with correct constructor and propertyName", () => {
const config: Omit<AtomicConstraintsPropertySchema, "name"> = {
values: [
{
id: 0,
value: [true, true, false],
},
],
};

const atomicConstraintsProperty = new AtomicConstraintsProperty(config);

expect(atomicConstraintsProperty).to.be.instanceOf(AtomicConstraintsProperty);
expect(AtomicConstraintsProperty.propertyName).equal(PropertyName.atomic_constraints);
});
});
Loading