Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
de42fbfb
Commit
de42fbfb
authored
7 months ago
by
Mikhail Svechnikov
Browse files
Options
Downloads
Patches
Plain Diff
only header in codeHeader
parent
6f782e0c
No related branches found
No related tags found
1 merge request
!2720
Avoid duplication of header in generated script
Pipeline
#158030
passed
7 months ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sim/Export/ExportToPython.cpp
+3
-2
3 additions, 2 deletions
Sim/Export/ExportToPython.cpp
Sim/Export/SimulationToPython.cpp
+1
-1
1 addition, 1 deletion
Sim/Export/SimulationToPython.cpp
with
4 additions
and
3 deletions
Sim/Export/ExportToPython.cpp
+
3
−
2
View file @
de42fbfb
...
...
@@ -20,12 +20,13 @@
std
::
string
Py
::
Export
::
codeHeader
(
const
std
::
string
&
code
)
{
return
"import bornagain as ba
\n
"
+
Py
::
Fmt
::
printImportedSymbols
(
code
)
+
"
\n\n
"
+
code
;
return
"import bornagain as ba
\n
"
+
Py
::
Fmt
::
printImportedSymbols
(
code
)
+
"
\n\n
"
;
}
std
::
string
Py
::
Export
::
sampleCode
(
const
MultiLayer
&
sample
)
{
return
Py
::
Export
::
codeHeader
(
SampleToPython
().
sampleCode
(
sample
));
std
::
string
sample_code
=
SampleToPython
().
sampleCode
(
sample
);
return
Py
::
Export
::
codeHeader
(
sample_code
)
+
sample_code
;
}
std
::
string
Py
::
Export
::
simulationPlotCode
(
const
ISimulation
&
simulation
)
...
...
This diff is collapsed.
Click to expand it.
Sim/Export/SimulationToPython.cpp
+
1
−
1
View file @
de42fbfb
...
...
@@ -368,7 +368,7 @@ std::string simulationCode(const ISimulation& simulation)
ASSERT
(
simulation
.
sample
());
std
::
string
code
=
SampleToPython
().
sampleCode
(
*
simulation
.
sample
())
+
defineSimulate
(
simulation
);
return
Py
::
Export
::
codeHeader
(
code
);
return
Py
::
Export
::
codeHeader
(
code
)
+
code
;
}
}
// namespace
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment