expressions

package
v3.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Data structures used to store expressions (both Lua and PIXLang expression code)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataExpression

type DataExpression struct {
	ID               string                 `json:"id" bson:"_id"` // Use as Mongo ID
	Name             string                 `json:"name"`
	SourceCode       string                 `json:"sourceCode"`
	SourceLanguage   string                 `json:"sourceLanguage"` // LUA vs PIXLANG
	Comments         string                 `json:"comments"`
	Tags             []string               `json:"tags"`
	ModuleReferences []ModuleReference      `json:"moduleReferences,omitempty" bson:"moduleReferences,omitempty"`
	Origin           pixlUser.APIObjectItem `json:"origin"`
	// NOTE: if modifying below, ensure it's in sync with ExpressionDB StoreExpressionRecentRunStats()
	RecentExecStats *DataExpressionExecStats `json:"recentExecStats,omitempty" bson:"recentExecStats,omitempty"`
	DOIMetadata     zenodoModels.DOIMetadata `json:"doiMetadata,omitempty" bson:"doiMetadata,omitempty"`
}

func (DataExpression) SetTimes

func (a DataExpression) SetTimes(userID string, t int64)

type DataExpressionExecStats

type DataExpressionExecStats struct {
	DataRequired     []string `json:"dataRequired"`
	RuntimeMS        float32  `json:"runtimeMs"`
	TimeStampUnixSec int64    `json:"mod_unix_time_sec,omitempty"`
}

Stats related to executing an expression. We get these from the UI when it runs an expression, and we (may) supply them when UI queries for expressions. This way the UI can know what expression is compatible with currently loaded quant file, and can "strike-through" ones that aren't. This was previously implemented client-side only by parsing expression text but we no longer supply ALL expression texts to client

type DataExpressionInput

type DataExpressionInput struct {
	Name             string            `json:"name"`
	SourceCode       string            `json:"sourceCode"`
	SourceLanguage   string            `json:"sourceLanguage"` // LUA vs PIXLANG
	Comments         string            `json:"comments"`
	Tags             []string          `json:"tags"`
	ModuleReferences []ModuleReference `json:"moduleReferences,omitempty" bson:"moduleReferences,omitempty"`
	DOIMetadata      zenodoModels.DOIMetadata
}

What users send in POST and PUT

type DataExpressionLookup

type DataExpressionLookup map[string]DataExpression

type DataExpressionWire

type DataExpressionWire struct {
	ID               string            `json:"id"`
	Name             string            `json:"name"`
	SourceCode       string            `json:"sourceCode"`
	SourceLanguage   string            `json:"sourceLanguage"` // LUA vs PIXLANG
	Comments         string            `json:"comments"`
	Tags             []string          `json:"tags"`
	ModuleReferences []ModuleReference `json:"moduleReferences,omitempty" bson:"moduleReferences,omitempty"`
	*pixlUser.APIObjectItem
	// NOTE: if modifying below, ensure it's in sync with ExpressionDB StoreExpressionRecentRunStats()
	RecentExecStats *DataExpressionExecStats `json:"recentExecStats,omitempty" bson:"recentExecStats,omitempty"`
	DOIMetadata     zenodoModels.DOIMetadata `json:"doiMetadata,omitempty" bson:"doiMetadata,omitempty"`
}

We used to store origin info in the same struct as expression... TODO: Remove this eventually and modify UI to work the new way too

type ModuleReference

type ModuleReference struct {
	ModuleID string `json:"moduleID"`
	Version  string `json:"version"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL