Skip to content

Commit

Permalink
update scripts with comments that now provide tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Jun 6, 2024
1 parent 62feca0 commit d8cdce1
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 31 deletions.
4 changes: 4 additions & 0 deletions simscripts/00-Jobs.cosh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Jobs updates the Jobs tab with a Table showing all the Jobs
// with their meta data. Uses the dbmeta.toml data compiled from
// the Status function.

// note: br is browser

func OpenJobs(path string) {
Expand Down
5 changes: 5 additions & 0 deletions simscripts/10-Status.cosh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Status gets updated job.* files from the server for any job that
// doesn't have a Finalized or Fetched status. It updates the
// status based on the server job status query, assigning a
// status of Finalized if job is done. Updates the dbmeta.toml
// data based on current job data.

// JobStatus gets job status from server for given job id.
// jobs that are already Finalized are skipped, unless force is true.
Expand Down
4 changes: 4 additions & 0 deletions simscripts/20-Fetch.cosh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Fetch retrieves all the .tsv data files from the server
// for any jobs not already marked as Fetched.
// Operates on the jobs selected in the Jobs table,
// or on all jobs if none selected.

// FetchJob downloads results files from server.
// if force == true then will re-get already-Fetched jobs,
Expand Down
6 changes: 4 additions & 2 deletions simscripts/30-Submit.cosh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// This submit script handles the SLURM array job case, with an outer
// startup job that calls the main array jobs and a final cleanup job.
// Submit submits a job to SLURM on the server, using an array
// structure, with an outer startup job that calls the main array
// jobs and a final cleanup job. Creates a new job dir based on
// incrementing counter, synchronizing the job files.

// WriteSBatchHeader writes the header of a SLURM SBatch script
// that is common across all three scripts.
Expand Down
5 changes: 4 additions & 1 deletion simscripts/50-Results.cosh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// Loads data for specific jobs results
// Results loads specific .tsv data files from the jobs selected
// in the Jobs table, into the Results table. There are often
// multiple result files per job, so this step is necessary to
// choose which such files to select for plotting.

func OpenResultFiles(jobs []string, filter FilterResults) {
for i, jid := range jobs {
Expand Down
3 changes: 3 additions & 0 deletions simscripts/55-Diff.cosh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Diff shows the differences between two selected jobs, or if only
// one job is selected, between that job and the current source directory.

func DiffJobs() {
@0
tv := JobsTableView
Expand Down
27 changes: 3 additions & 24 deletions simscripts/60-Plot.cosh
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@

// TableWithNewKeyColumns returns a copy of the Table with new columns
// having given values, inserted at the start, used as legend keys etc.
// args are column name, value pairs.
func TableWithNewKeyColumns(dt *table.Table, args ...string) *table.Table {
n := len(args)
if n % 2 != 0 {
fmt.Println("TableWithNewColumns requires even number of args as colnm, value pairs")
return dt
}
c := dt.Clone()
nc := n / 2
for j := 0; j < nc; j++ {
colNm := args[2 * j]
val := args[2 * j+1]
col := tensor.NewString([]int{c.Rows})
c.InsertColumn(col, colNm, 0)
for i := range col.Values {
col.Values[i] = val
}
}
return c
}
// Plot concatenates selected Results data files and generates a plot
// of the resulting data.

func PlotResults() {
tv := ResultsTableView
Expand All @@ -34,7 +13,7 @@ func PlotResults() {
res := Results[i]
jid := res.JobID
label := res.Label
dt := TableWithNewKeyColumns(res.Table, "JobID", jid, "JobLabel", label)
dt := br.TableWithNewKeyColumns(res.Table, "JobID", jid, "JobLabel", label)
if AggTable == nil {
AggTable = dt
} else {
Expand Down
7 changes: 3 additions & 4 deletions simscripts/65-Reset.cosh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Reset resets the Results table

func ResetResults() {
Results = []*Result{}
// TODO: currently crashing:
// br.NewTabTableView("Results", &Results)
// br.Update()
core.MessageSnackbar(br, "for now, delete Results tab manually")
br.NewTabTableView("Results", &Results)
br.Update()
}

ResetResults()
Expand Down
3 changes: 3 additions & 0 deletions simscripts/70-Cancel.cosh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Cancel cancels the jobs selected in the Jobs table,
// with a confirmation prompt.

// CancelJobs cancels the given jobs
func CancelJobs(jobs []string, path string) {
@0
Expand Down
3 changes: 3 additions & 0 deletions simscripts/80-Delete.cosh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Delete deletes the jobs selected in the Jobs table,
// with a confirmation prompt.

// DeleteJobs deletes the given jobs
func DeleteJobs(jobs []string, path string) {
@0
Expand Down
2 changes: 2 additions & 0 deletions simscripts/90-Config.cosh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Config shows the configuration data.

// EditConfig edits the configuration
func EditConfig() {
databrowser.PromptStruct(br, &Config, "Configuration parameters", nil)
Expand Down

0 comments on commit d8cdce1

Please sign in to comment.