Skip to content

Instantly share code, notes, and snippets.

@chrispahm
Created August 9, 2019 12:52
Show Gist options
  • Save chrispahm/28bef86e4d79a5b69eda2112c59bcb45 to your computer and use it in GitHub Desktop.
Save chrispahm/28bef86e4d79a5b69eda2112c59bcb45 to your computer and use it in GitHub Desktop.
Find out all active parameters currently used in a GAMS model (using Atom linter-gams)
// open the developer console in Atom (ctrl-shift-i on Windows)
// and paste the following code in order to get a list of all
// active parameters currently used in the GAMS model
global.gamsView.filter(elem => {
function checkRef(ref) {
let flag = false
ref.forEach(ref => {
if (ref.file.includes('templ.gms') || ref.file.includes('model')) flag = true
})
return flag
}
return elem.type === 'PARAM' && elem.ref && checkRef(elem.ref)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment