Giter Club home page Giter Club logo

simplebuild-dgcode's People

Contributors

dependabot[bot] avatar milanklausz avatar tkittel avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

milanklausz

simplebuild-dgcode's Issues

clean up utils and docs for internal ess utils

A few ESS related utils exists in dgcode, and we might as well move them elsewhere.

We also need to augment the docs for ESS based users, by having a landing page in the intranet with a list of where to find and clone internal project repos, etc.

Git cloning from private repos fails in dependabot triggered workflows

Git cloning from private repos fails in dependabot triggered workflows, as explained here:

https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#accessing-secrets

First of all, we should add a proper check to the relevant workflows to verify that the token is nonempty.

Secondly, we can either just live with this, or we can add the same tokens also as an identically named dependabot secret.

Add to conda-forge

Now simple-build-system is on conda-forge, we should add simple-build-dgcode as well.

classic g4viewer code needs updating

For instance, sb_g4utils_geodisplay --g4viewer dies with:

G4Launcher:: Applying command: /vis/open OGLSXm
parameter value (OGLSXm) is not listed in the candidate List.
  Candidates are: ASCIITree ATree DAWNFILE G4HepRepFile HepRepFile RayTracer VRML2FILE gMocrenFile TOOLSSG_OFFSCREEN TSG_OFFSCREEN TOOLSSG_OFFSCREEN TSG_OFFSCREEN TSG_FILE OpenGLImmediateQt OGLIQt OGLI OpenGLStoredQt OGLSQt OGL OGLS OpenGLImmediateX OGLIX OpenGLStoredX OGLSX RayTracerX TOOLSSG_X11_GLES TSG_X11_GLES TSGX11 TOOLSSG_QT_GLES TSG_QT_GLES TSGQt TSG

update doc links

Grepping reveals many in-code links to the old confluence pages.

Fix Geant4 log irreproduciblities

Geant4 in conda versus standalone might have issues:

diff --git a/ESSBoronTestCell/EBTCScripts/scripts/testchain.log b/ESSBoronTestCell/EBTCScripts/scripts/testchain.log
index bec1cdf98..b541c59fd 100644
--- a/ESSBoronTestCell/EBTCScripts/scripts/testchain.log
+++ b/ESSBoronTestCell/EBTCScripts/scripts/testchain.log
@@ -70,13 +70,16 @@ GriffDataReader opened file ebtc.griff
     "G4VersionNumber" : "1103"
     "GriffMode" : "REDUCED"
     "RandEngine" : "NCrystalXoroshiroEngine"
+    "datadir/G4ABLADATA" : "G4ABLA3.1"
+    "datadir/G4ENSDFSTATEDATA" : "G4ENSDFSTATE2.3"
+    "datadir/G4INCLDATA" : "G4INCL1.0"
     "datadir/G4LEDATA" : "G4EMLOW8.0"
-    "datadir/G4LEVELGAMMADATA" : "PhotonEvaporation5.7"
+    "datadir/G4LEVELGAMMADATA" : "G4PhotonEvaporation5.7"
     "datadir/G4NEUTRONHPDATA" : "G4NDL4.6"
-    "datadir/G4NEUTRONXSDATA" : ""
+    "datadir/G4PARTICLEXSDATA" : "G4PARTICLEXS4.0"
     "datadir/G4PIIDATA" : "G4PII1.3"
-    "datadir/G4RADIOACTIVEDATA" : "RadioactiveDecay5.6"
-    "datadir/G4REALSURFACEDATA" : "RealSurface2.2"
+    "datadir/G4RADIOACTIVEDATA" : "G4RadioactiveDecay5.6"
+    "datadir/G4REALSURFACEDATA" : "G4RealSurface2.2"
     "datadir/G4SAIDXSDATA" : "G4SAIDDATA2.0"
     "genName" : "G4StdGenerators/ProfiledBeamGen"
     "geoName" : "G4GeoEBTC/GeoEBTC"
diff --git a/SingleCell/G4SimSingleCell/scripts/testchain.log b/SingleCell/G4SimSingleCell/scripts/testchain.log
index db71c2795..fba059199 100644
--- a/SingleCell/G4SimSingleCell/scripts/testchain.log
+++ b/SingleCell/G4SimSingleCell/scripts/testchain.log
@@ -88,13 +88,16 @@ GriffDataReader opened file sc.griff
     "G4VersionNumber" : "1103"
     "GriffMode" : "REDUCED"
     "RandEngine" : "NCrystalXoroshiroEngine"
+    "datadir/G4ABLADATA" : "G4ABLA3.1"
+    "datadir/G4ENSDFSTATEDATA" : "G4ENSDFSTATE2.3"
+    "datadir/G4INCLDATA" : "G4INCL1.0"
     "datadir/G4LEDATA" : "G4EMLOW8.0"
-    "datadir/G4LEVELGAMMADATA" : "PhotonEvaporation5.7"
+    "datadir/G4LEVELGAMMADATA" : "G4PhotonEvaporation5.7"
     "datadir/G4NEUTRONHPDATA" : "G4NDL4.6"
-    "datadir/G4NEUTRONXSDATA" : ""
+    "datadir/G4PARTICLEXSDATA" : "G4PARTICLEXS4.0"
     "datadir/G4PIIDATA" : "G4PII1.3"
-    "datadir/G4RADIOACTIVEDATA" : "RadioactiveDecay5.6"
-    "datadir/G4REALSURFACEDATA" : "RealSurface2.2"
+    "datadir/G4RADIOACTIVEDATA" : "G4RadioactiveDecay5.6"
+    "datadir/G4REALSURFACEDATA" : "G4RealSurface2.2"
     "datadir/G4SAIDXSDATA" : "G4SAIDDATA2.0"
     "genName" : "G4StdGenerators/FlexGen"
     "geoName" : "G4GeoSingleCell/GeoB10SingleCell"

Viewer doesnt contract grand-daughters properly

(old issue from 2016, transferred from old system @ ESS, not confirmed in new system)

First expand a volume and then one of several sub-volumes to show both some daughters and grand-daughters at the same time. Now, trigger contraction of the original volume by shift-middle-clicking on a daughter does hide the daughters, but leaves grand-daughters visible.

add matplotlib as extdep

If running without matplotlib, a few handful(s) of tests fail. This should be handled properly with a dedicated extdep.

A function declaration without a prototype is deprecated in all versions of C

After upgrading to XCode 14.3 (requires macOS Ventura 13.0 or later), I get a lot of compillation errors (warnings treated as errors) saying "A function declaration without a prototype is deprecated in all versions of C".
This is because "C2x will be removing support for functions with identifier lists, and will be changing the behavior of prototypeless functions with empty parentheses to match the behavior of C++" (from link)

A lot of functions in MiniZLib use the now unsupported identifier lists (a part of K&R-style function definition syntax). The errors/warnings could be silenced by using DG_EXTRA_CFLAGS=-Wno-strict-prototypes compillation flag (as suggested in madler/zlib#633 ), but for us it would be better to change the function definitions:

int foo(s, f)
  char* s;
  float f;
{
  return 5;
}

to

int foo(char* s, float f)
{
  return 5;
}

Also, for similar reason, empty parameter lists should be given an explicit parameter of void:

int foo()
{
  return 5;
}

to

int foo(void)
{
  return 5;
}

setup CI for ESS repos

We should make sure to once in a while exercise our code on the large amount of packages in the internal ESS repos.

PyAna/extras tex font settings might need updating

As evidenced in various warnings and this local uncommitted hack, the PyAna/extras tex font settings might need updating:

--- a/packages/Framework/PyAnalysis/PyAna/python/extras.py
+++ b/packages/Framework/PyAnalysis/PyAna/python/extras.py
@@ -59,10 +59,25 @@ def floatToScientificLatex(x):
 
 def enable_tex_fonts():
     import matplotlib
-    matplotlib.rcParams.update({'text.usetex':1,
-                                'font.family':'serif',
-                                'font.serif':['cmr10','cm'],
-                                'text.latex.preamble' : r'\usepackage{amsmath}'})#LaTeX fonts
+
+    matplotlib.rcParams.update({
+        # Use mathtext, not LaTeX
+        'text.usetex': False,
+        # Use the Computer modern font
+        'font.family': 'serif',
+        'font.serif': 'cmr10',
+        'mathtext.fontset': 'cm',
+        # Use ASCII minus
+        'axes.unicode_minus': False,
+        #cmr10 needs axis formatter to use mathtext:
+        'axes.formatter.use_mathtext': True,
+    })
+    #
+    #matplotlib.rcParams.update({'text.usetex':1,
+    #                            'font.family':'serif',
+    #                            'font.serif':['cmr10','cm'],
+    #                            'text.latex.preamble' : r'\usepackage{amsmath}'})#LaTeX fonts
+

MCPLGen's skip_events int parameter imposes a 2^31 event limit for processing MCPL files

MCPL files containing more that 2^31 events are difficult to processes due to the skip_events parameter of the MCPL generator being an integer.

The issue occurs when I run a McStas simulation to produce an MCPL file - containing neutrons scattered on a sample - that I want to use a source of particles for the subsequent Geant4 simulation of the detection process. I use the ess_dmscutils_submit tool to submit a lot of simulation jobs with 1e5 events in each, using the skip_events parameter in accordance with the job id, but that stops working when it reaches the 2^31 integer limit.

My current solution is splitting the large MCPL files, and processing them separately, but it would be nice to avoid that extra manual step (which is also a potential source of errors).

Not entirely trivial fixes for the documentation

  • 1) intro: “Most importantly, dgcode includes functionality for easy seting up and launching of Geant4 simulation jobs based on configurable geometry and generator modules(...)

  • Could we use “Particle generators” instead of “generator modules” here? (unless generator module is a Geant4 term that we expect the readers to understand even in the introduction.)

  • The same for “Generators are likewise (...)“, in Features

  • 2) newsimproject: “An analysis program which can be invoked via the command sb_tricorder_ana and which is used to run on the Griff files and which will result in a SimpleHists file being created with analysis histograms.

  • The ’and which will results in a (...)” part confusing refers to the ’run on Griff files', while the first ‘and which’ refers to the ana file itself.

  • being created with analysis histograms” does this mean “consisting of analysis histograms”?

  • 3) griff: Extend the “How to enable Griff output” section with info about the multiple griff files created when using -jN (mystuff.0.griff to mystuff.[N-1].griff). (The tip in Analysing Griff files / Basic approach assumes this knowledge later on “Multiple input files can be chained together by specifying them with a wildcard, e.g. mysim.*.griff” ). Maybe put it after “Which changes the default to be to write Griff output in REDUCED mode to a file named mystuff.griff.

  • 4) scans: In the example, sample_radius_mm is changed, but in the text it says “The first plot will vary a detector thickness” (it is a bit confusing for me, even if the sample is the detector in this context(?))

  • 5) simplehists: The ‘Example: Python analysis of histograms’ script at the bottom of the page is supposed to be a "small example of how one can get data out in formats ready to input to the various pylab plotting routines"; which is probably true, but I don't see the need for the “import pylab as pl” line.

  • 6) mcpl: “The sb_mcplextra_filterview command can be used to produce a new MCPL file from an existing one, containing only a subset of the original particles. (...)“.

  • The filterview script is introduced instead of sb_mcplextra_filterfile, that is actually used in the following examples.

  • This is the only mentioning of the filterview script/command, so I guess a paragraph dedicated to it is missing.

  • 7) In newsimproject, it is stated that “For the sake of the following discussions, we will assume you are creating a completely fresh working directory in which you wish to work (this might of course not be the case).” but a little bit later the user is reassured that “Of course, if you are working with code in a shared repository (e.g. at GitHub), nothing has been added to the remote repository at this point. (...)” It is a bit controversial for me. I think this should be restructured a bit to separate the part of creating a bundle (unless working in an existing one), and creating a new package. Restructure part between:
    For the sake of the following discussions” AND
    Rather, you are now expected to modify the files as appropriate for your actual project before finally git add’ing and committing and pushing them to the central repository server.

  • 8 ) particlegenerators: “The is used to select which histogram from the file to use, and the optional part can be specified either as a name or a number.” For the ‘number’ option, you have to know the default Geant4 unit and provide the conversion factor? (Should we point at some sort of default Geant4 units list?)

  • 9) particlegenerators: “Note that in addition to the actual bin-contents of the histogram, the sampler also considers the min/max statistics as well as any underflow/overflow content.” How does it consider the underflow/overflow content?

  • 10) sbparticlegen.rst “As important for a Geant4 simulation as geometry, materials and physics list, is the initial set of particles to be “let loose” in the simulation each event” This might be only confusing for my ear, as I’m not used to the Geant4 meaning of an “event”, can we maybe put in an extra word somewhere? (it is probalbly not important)

The followings are suggested additions:

  • 11) install: Maybe add a sentence after “conda env create -f conda_dgcode.yml”, that depending on the internet connection, it might take several minutes and the resulting conda environment will take up ~3.8G(?) disk space.

  • 12) newsimproject: simplebuild.cfg file is first mentioned here as “As written, new packages and files have been created for you in your local directory (defaulting to the directory of your master simplebuild.cfg file)“.
    We might want to link to simplebuild documentation (sbdotcfg or automatic-creation) a little bit earlier when asking the user to invoke sb --init dgcode, mentioning that this command will create the (master) simplebuild.cfg file (just to avoid confusion).

  • 13) particlegenerators: At the end of “Generating from Griff files” (after the part about “(...)Griff file was created with a certain filter to select the particles (...)“) Maybe I’d add that together with the visualisation tool (--aim / --data), it can be a very powerful tool for debugging / understanding unexpected events, e.g. by finding unexpected particle paths.

ncrystaldev test failure

024-03-01T08:53:48.9993570Z ====> First 100 lines from sb_ncextratests_testdosana/refdiff.log:
2024-03-01T08:53:48.9996030Z ====>
2024-03-01T08:53:48.9996760Z 276,277c276,277
2024-03-01T08:53:49.0000050Z < CALLING plt.plot(['-0.219', '-0.219', '-0.219', '...', '0.219', '0.219', '0.219'],['6.35e-16', '7.25e-16', '1.01e-15', '...', '1.72e-15', '1.15e-15', '1.46e-15'],color='#F15854',label='Al')
2024-03-01T08:53:49.0004200Z < CALLING plt.plot(['-0.219', '-0.219', '-0.219', '...', '0.219', '0.219', '0.219'],['1.24e-15', '1.1e-15', '6.83e-16', '...', '1.19e-15', '3.78e-16', '4.69e-17'],color='#5DA5DA',label='N')
2024-03-01T08:53:49.0006450Z ---
2024-03-01T08:53:49.0008250Z > CALLING plt.plot(['-0.219', '-0.219', '-0.219', '...', '0.219', '0.219', '0.219'],['1.19e-15', '7.06e-16', '7.77e-16', '...', '1.96e-15', '1.77e-15', '2.41e-15'],color='#F15854',label='Al')
2024-03-01T08:53:49.0011260Z > CALLING plt.plot(['-0.219', '-0.219', '-0.219', '...', '0.219', '0.219', '0.219'],['1.82e-15', '1.65e-15', '1.35e-15', '...', '1.63e-15', '9.27e-16', '5.89e-16'],color='#5DA5DA',label='N')
2024-03-01T08:53:49.0040770Z sbld:  ====> (end of sb_ncextratests_testdosana/refdiff.log)
2024-03-01T08:53:49.0091310Z 
2024-03-01T08:53:49.0122390Z sbld:  
2024-03-01T08:53:49.0134450Z ====>
2024-03-01T08:53:49.0153140Z ====> Last 100 lines from sb_ncextratests_testdosana/refdiff.log:
2024-03-01T08:53:49.0179080Z ====>
2024-03-01T08:53:49.0209180Z 276,277c276,277
2024-03-01T08:53:49.0245430Z < CALLING plt.plot(['-0.219', '-0.219', '-0.219', '...', '0.219', '0.219', '0.219'],['6.35e-16', '7.25e-16', '1.01e-15', '...', '1.72e-15', '1.15e-15', '1.46e-15'],color='#F15854',label='Al')
2024-03-01T08:53:49.0250760Z < CALLING plt.plot(['-0.219', '-0.219', '-0.219', '...', '0.219', '0.219', '0.219'],['1.24e-15', '1.1e-15', '6.83e-16', '...', '1.19e-15', '3.78e-16', '4.69e-17'],color='#5DA5DA',label='N')
2024-03-01T08:53:49.0287940Z ---
2024-03-01T08:53:49.0320890Z > CALLING plt.plot(['-0.219', '-0.219', '-0.219', '...', '0.219', '0.219', '0.219'],['1.19e-15', '7.06e-16', '7.77e-16', '...', '1.96e-15', '1.77e-15', '2.41e-15'],color='#F15854',label='Al')
2024-03-01T08:53:49.0358850Z > CALLING plt.plot(['-0.219', '-0.219', '-0.219', '...', '0.219', '0.219', '0.219'],['1.82e-15', '1.65e-15', '1.35e-15', '...', '1.63e-15', '9.27e-16', '5.89e-16'],color='#5DA5DA',label='N')
2024-03-01T08:53:49.0363070Z sbld:  ====> (end of sb_ncextratests_testdosana/refdiff.log)
2024-03-01T08:53:49.0595360Z 
2024-03

stop talking about pylab in the docs

For historical reasons, a lot of the docs still refer to "pylab", which is not really appropriate, since most of the time we simply mean either numpy or matplotlib.

Make convenient utilities based on exprparser

use g4exprparser to add convenient --print and --plot options, for instance:

sb_xxx_sim --print="step.pre.ekin/meV:step,trk.is_primary where trk.is_neutron and step.volname=='Sample'"

To get on-the-fly lines printed from the simulation for neutrons stepping through volumes named Sample of two variables: kinetic energy in meV and a number indication that the particle is primary (1) or secondary (0).

We could also extract .shist files in this manner!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.