Improving Code Comments

This commit is contained in:
Luis Fernando Molina committed 2021-02-01 13:50:46 +01:00
1 parent ab9cc4afdf
commit f42a46dc48
3 files changed
+53 -16

No files matched your search

@@ -587,23 +587,44 @@
}
function buildCharts(chart) {
/* Fisrt Phase: Validations */
let mainDependency = {}
/* The first phase here is about checking that we have everything we need at the definition level. */
/*
THe first thing we do is to build an array of all the
declared dependencies of the Trading Bot.
*/
let dataDependencies = TS.projects.superalgos.utilities.nodeFunctions.nodeBranchToArray(TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processDependencies, 'Data Dependency')
/*
We will filter ourt declared dependencies that are not present in the workspace.
This will allow the user to have less Data Mines loaded at the workspace
that the ones that a Trading Mine depends on.
Then we will filter out declared dependencies that are
not referencing nodes currently present at the workspace.
This will allow the user to have less Data Mines loaded at
the workspace that the ones that a Trading Bot depends on.
*/
dataDependencies = TS.projects.superalgos.utilities.nodeFunctions.filterOutNodeWihtoutReferenceParentFromNodeArray(dataDependencies)
/*
We will run some validations to prevent starting the process
if all needed config and nodes are not present.
*/
if (TS.projects.superalgos.functionLibraries.singleMarketFunctions.validateDataDependencies(processIndex, dataDependencies, callBackFunction) !== true) { return }
/*
Next we will build an array of output datasets of this process.
We are not going to use it right now, but later down the line,
we do it just to be able to validate that all nodes and config
are ok before letting this provess run too far.
*/
let outputDatasets = TS.projects.superalgos.utilities.nodeFunctions.nodeBranchToArray(TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset')
/*
Here we check that all output datasets configs are ok.
*/
if (TS.projects.superalgos.functionLibraries.singleMarketFunctions.validateOutputDatasets(processIndex, outputDatasets, callBackFunction) !== true) { return }
/* The second phase is about transforming the inputs into a format that can be used to apply the user defined code. */
/* Second Phase: Bilding the chart data structure */
/*
This phase is about transforming the inputs into a format,
or data structure that can be used in Javascript Code and
Formula nodes to access Indicator's data.
*/
for (let j = 0; j < TS.projects.superalgos.globals.timeFrames.marketFilesPeriods().length; j++) {
let timeFrameLabel = TS.projects.superalgos.globals.timeFrames.marketFilesPeriods()[j][1]
let dataFiles = multiPeriodDataFiles.get(timeFrameLabel)
@@ -1,5 +1,19 @@
exports.newSuperalgosProcessModulesDataDependencies = function (processIndex) {
/*
This module mantains a curated array of Data Dependency nodes,
which is not exactly the ones listed at the Process Dependencies,
but a smaller subset based on the circunstances found at the user's
workspace.
It also mantains an array of Data Set Modules, which are the
one's that ultimately know how to load a file based on the
network configuration found at the workspace at the moment this
Task was launched.
Finally it mantains a Filter map, that allows the users of this module
to filter out data dependencies based on the code written by users
at the Javascript Code and Formula nodes.
*/
const MODULE_NAME = "Data Dependencies";
let thisObject = {
@@ -28,7 +42,7 @@
return
}
/*
We will filter ourt declared dependencies that are not present in the workspace.
We will filter out declared dependencies that are not present in the workspace.
This will allow the user to have less Data Mines loaded at the workspace
that the ones that a Trading Mine depends on.
*/
@@ -72,7 +86,7 @@
out is by analizyng the response of the initialization call to the DataSet module. If it did not fail but
it was not initialized, then we will assume this happened because the data could not be located and we will
assume the user did this on purpose and we will filter out this dependency by not putting it on this new array.
*/
*/
let newNodeArray = []
for (let i = 0; i < thisObject.nodeArray.length; i++) {
@@ -92,14 +106,14 @@
if (wasInitialized === true) {
addCount++;
newNodeArray.push(thisObject.nodeArray[i])
addDataSet()
addDataSet()
} else {
skipCount++
}
checkIfWeAreDone()
checkIfWeAreDone()
}
function addDataSet() {
function addDataSet() {
thisObject.dataSetsModulesArray.push(dataSetModule);
}
@@ -1,5 +1,9 @@
exports.newSuperalgosProcessModulesDataset = function (processIndex) {
/*
This module represents a Dataset at a certain localtion on the
network, and it is able to load a file from that dataset or
write one into it.
*/
const MODULE_NAME = "Dataset";
let thisObject = {
@@ -12,8 +16,6 @@ exports.newSuperalgosProcessModulesDataset = function (processIndex) {
};
/* Storage account to be used here. */
let fileStorage
return thisObject;