Created
August 9, 2019 12:52
-
-
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)
This file contains 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
// 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