-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/SOF-6991: MODEL_TREE removal #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
azech-hqs
wants to merge
62
commits into
chore/SOF-6991-js
Choose a base branch
from
chore/SOF-6991
base: chore/SOF-6991-js
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
69b56e2
chore: use dotfile for mocha
azech-hqs 44175b9
update: enable typescript
azech-hqs 11c7bdf
chore: move model interface from web-app
azech-hqs 26947e5
chore: inherit from defaultabe in-memory entity
azech-hqs 01d76c7
chore: add mui-path-imports eslint plugin
azech-hqs 8423eb1
update: add application-flavor package
azech-hqs 6207882
chore: adjust imports of modelinterface
azech-hqs 8586512
refactor: remove model tree from model class
azech-hqs 5bd029a
update: inherit from defaultable in-memory entity
azech-hqs c4e182f
refactor: move slug related functions to utils
azech-hqs e5d9311
chore: add typescript + utils
azech-hqs 864237a
chore: fix mocha settings
azech-hqs 0e652ee
chore: remove redundant mixwith package
azech-hqs 1179945
refactor: isolate filtering the model list
azech-hqs a3611a9
refactor: replace slug method with utils
azech-hqs 3b672ff
update: get default config from model list
azech-hqs d7c090f
test: default functional of dft model
azech-hqs 0c0fdeb
docs: add docstring to getCategorizedModels()
azech-hqs 9ea2848
chore: use explicit import for lodash
azech-hqs a640a65
chore: remove UI-related functions
azech-hqs 4e7e622
chore: add separate instance method for default config
azech-hqs 1146919
chore: avoid recursion in default getters
azech-hqs b35e192
refactor: replace tree in model factory
azech-hqs a4e6620
test: create dft model via factory
azech-hqs 110b9f8
codejs++: use 2023.10.24-0
azech-hqs ddbdfc7
appl-flavors++: use chore/SOF-6991
azech-hqs 81e9d6d
chore: fix create from application
azech-hqs 00916a3
test: create dft model from application
azech-hqs 4daaf55
test: move model test to typescript
azech-hqs abc1a68
update: use model interface of chore/SOF-6706
azech-hqs d358815
update: add method interface
azech-hqs 0aee1ae
update: create default method from model+application
azech-hqs a38e379
test: verify method type for default dft model
azech-hqs 2ccecce
refactor: use lodash for sortby util
azech-hqs c7ffe04
style: remove redundant comment
azech-hqs dd31530
chore: add method filter functions to interface
azech-hqs c830a31
chore: remove unused functions
azech-hqs 6026e7e
refactor: move default_models to typescript
azech-hqs 6ee7c07
refactor: move default_methods to typescript
azech-hqs d76c4c3
refactor: remove model tree
azech-hqs 46019aa
refactor: move filter functions to separate file
azech-hqs 4183b68
update: add filter function to model interface
azech-hqs 4801e84
refactor: use filter functions from interfaces
azech-hqs 8b3c3c7
chore: add safeguards for undefined params
azech-hqs dce6f12
chore: re-implement tree utility functions
azech-hqs a2499d5
test: verify tree utility functions
azech-hqs 1f1b629
chore: add tsconfig to files
azech-hqs df5b849
update: adjust tree utility functions based on model list
azech-hqs 32d1b8a
test: verify tree utility functions II
azech-hqs 70a605d
chore: assume model without method in interface
azech-hqs fdbdc7d
update: handle unknown model case
azech-hqs fe962bb
test: unknown model is created correctly
azech-hqs a2d989c
chore: handle undefined functional case
azech-hqs 606b1cd
codejs++: use chore/SOF-6991
azech-hqs 110e53a
appl-flavors++: update chore/SOF-6991
azech-hqs 5c6b47e
test: default models for applications
azech-hqs 2383514
chore: return legacy model if no application
azech-hqs 36851f7
refactor: move tree.js to typescript
azech-hqs e21ba6e
test: default dft model + group slug
azech-hqs cb5b68e
chore: handle case of functional as string
azech-hqs 1c5655a
chore: add plugin for typescript imports
azech-hqs 2c87456
test: functional as slugifiedEntry
azech-hqs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| { | ||
| "extends": ["@exabyte-io/eslint-config"] | ||
| "extends": [ | ||
| "@exabyte-io/eslint-config", | ||
| "plugin:import/typescript" | ||
| ] | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "extension": ["ts", "js"], | ||
| "spec": "tests/**/*.test.*", | ||
| "require": ["ts-node/register"] | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { | ||
| LegacyMethodLocalorbital, | ||
| LegacyMethodPseudopotential, | ||
| LegacyMethodUnknown, | ||
| } from "@exabyte-io/code.js/dist/types"; | ||
|
|
||
| export const PseudopotentialMethodConfig: LegacyMethodPseudopotential = { | ||
| type: "pseudopotential", | ||
| subtype: "us", | ||
| }; | ||
|
|
||
| export const LocalOrbitalMethodConfig: LegacyMethodLocalorbital = { | ||
| type: "localorbital", | ||
| subtype: "pople", | ||
| }; | ||
|
|
||
| export const UnknownMethodConfig: LegacyMethodUnknown = { | ||
| type: "unknown", | ||
| subtype: "unknown", | ||
| }; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { | ||
| LegacyModelDensityFunctionalTheory, | ||
| LegacyModelUnknown, | ||
| } from "@exabyte-io/code.js/dist/types"; | ||
|
|
||
| export const DFTModelConfig: Omit<LegacyModelDensityFunctionalTheory, "method"> = { | ||
| type: "dft", | ||
| subtype: "gga", | ||
| }; | ||
|
|
||
| export const UnknownModelConfig: Omit<LegacyModelUnknown, "method"> = { | ||
| type: "unknown", | ||
| subtype: "unknown", | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import { filterEntityList, mergeTerminalNodes } from "@exabyte-io/code.js/dist/utils"; | ||
| import lodash from "lodash"; | ||
|
|
||
| import modelMethodMap from "./data/model_method_map"; | ||
|
|
||
| function safelyGet(obj, ...args) { | ||
| return lodash.get(obj, args, undefined); | ||
| } | ||
|
|
||
| /** | ||
| * Create list of filter objects based on model categories. | ||
| * @param {Object} filterTree - filter tree constructed from assets | ||
| * @param {string} tier1 - Level 1 tier | ||
| * @param {string} tier2 - Level 2 tier | ||
| * @param {string} tier3 - Level 3 tier | ||
| * @param {string} type - Type | ||
| * @param {string} subtype - Subtype | ||
| * @return {*[]} | ||
| */ | ||
| function getMethodFilterObjects({ filterTree, tier1, tier2, tier3, type, subtype }) { | ||
| let filterList; | ||
| if (!tier1) { | ||
| filterList = mergeTerminalNodes(filterTree); | ||
| } else if (!tier2) { | ||
| filterList = mergeTerminalNodes(safelyGet(filterTree, tier1)); | ||
| } else if (!tier3) { | ||
| filterList = mergeTerminalNodes(safelyGet(filterTree, tier1, tier2)); | ||
| } else if (!type) { | ||
| filterList = mergeTerminalNodes(safelyGet(filterTree, tier1, tier2, tier3)); | ||
| } else if (!subtype) { | ||
| filterList = mergeTerminalNodes(safelyGet(filterTree, tier1, tier2, tier3, type)); | ||
| } else { | ||
| filterList = safelyGet(filterTree, tier1, tier2, tier3, type, subtype); | ||
| } | ||
| const extractUniqueBy = (name) => { | ||
| return lodash | ||
| .chain(filterList) | ||
| .filter(Boolean) | ||
| .filter((o) => Boolean(o[name])) | ||
| .uniqBy(name) | ||
| .value(); | ||
| }; | ||
|
|
||
| return [].concat(extractUniqueBy("path"), extractUniqueBy("regex")); | ||
| } | ||
|
|
||
| /** | ||
| * Filter list of method configs based on model | ||
| * @param {Object[]} methodList - Array of method configs | ||
| * @param {Object} model - Model config for which methods should be filtered | ||
| * @return {Object[]} | ||
| */ | ||
| export function filterMethodsByModel({ methodList, model }) { | ||
| if (!model) return []; | ||
| const { categories } = model; | ||
| const filterObjects = getMethodFilterObjects({ filterTree: modelMethodMap, ...categories }); | ||
| return filterEntityList({ | ||
| entitiesOrPaths: methodList, | ||
| filterObjects, | ||
| multiPathSeparator: "::", | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you split this PR to two: 1) changes for removing model interface; 2) typescript, please? We'll take care of the 2) later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New PR (only JS) here: #35