Skip to content
Snippets Groups Projects
Commit ebb6d4a1 authored by Dillon Scott Fitzgerald's avatar Dillon Scott Fitzgerald
Browse files

Remove python file generation from Ntuple Wizard -- it will be handled in the...

Remove python file generation from Ntuple Wizard -- it will be handled in the Ntupling Service backend
parent 7acbbf4c
No related branches found
No related tags found
2 merge requests!76Update master with changes to alpha,!73Remove python file generation from Ntuple Wizard
Pipeline #7356000 failed
......@@ -32,7 +32,6 @@ import {
import {
Download,
ExclamationCircle,
FileEarmarkCode,
PencilSquare,
PlusLg,
QuestionCircle,
......@@ -42,7 +41,6 @@ import {
import {Route} from "react-router-dom";
import Select from "react-select";
import Creatable from "react-select/creatable";
import config from "../config";
import MetadataContext from "../contexts/MetadataContext";
import BKPath from "../lib/BKPath";
import DTTConfig from "../lib/DTTConfig";
......@@ -541,15 +539,6 @@ class LinesTable extends React.Component {
});
};
createPyOpts = (row) => {
const subdirectory = this.state.productionName;
const filename = row.dtt.getSafeName();
return Array(...config.pyOptsTemplate)
.join("\n")
.replace("{subdirectory}", subdirectory)
.replace("{filename}", filename);
};
processSubmission = () => {
if (this.state.submitLocation) {
this.setState({showReasonForRequestModal: true});
......@@ -567,7 +556,6 @@ class LinesTable extends React.Component {
generateAllFiles = () => {
return [
...this.state.rows.map((row) => [`${row.dtt.getSafeName()}.yaml`, yaml.dump(row.dtt.config)]),
...this.state.rows.map((row) => [`${row.dtt.getSafeName()}.py`, this.createPyOpts(row)]),
["info.yaml", yaml.dump(this.createInfoYaml())],
];
};
......@@ -752,28 +740,6 @@ class LinesTable extends React.Component {
<Download />
</Button>
</OverlayTrigger>
<OverlayTrigger
overlay={
<Tooltip>
Download python options file to load this DecayTreeTuple
from YAML
</Tooltip>
}
>
<Button
className="ms-auto"
type="button"
onClick={() =>
download(
this.createPyOpts(row),
`${row.dtt.getSafeName()}.py`
)
}
disabled={!this.state.productionName || !hasValidName}
>
<FileEarmarkCode />
</Button>
</OverlayTrigger>
</>
)}
......
......@@ -66,18 +66,5 @@
"height": "500px",
"autoResize": true,
"width": "100%"
},
"pyOptsTemplate": [
"# This file is generated by the NTuple Wizard <https://lbwizard.web.cern.ch>",
"",
"import os, yaml",
"from pathlib import Path",
"from Configurables import DaVinci",
"from AnalysisHelpers.decaytreetuple import configure_dtt",
"",
"config_file = Path(os.environ['ANALYSIS_PRODUCTIONS_BASE']) / '{subdirectory}' / '{filename}.yaml'",
"config = yaml.safe_load(open(config_file, 'rb'))",
"dtt = configure_dtt(config)",
"DaVinci().UserAlgorithms += [dtt]"
]
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment