Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug hunting in simex_platform and tutorials #147

Open
3 tasks
CFGrote opened this issue Apr 5, 2018 · 4 comments
Open
3 tasks

Bug hunting in simex_platform and tutorials #147

CFGrote opened this issue Apr 5, 2018 · 4 comments

Comments

@CFGrote
Copy link
Collaborator

CFGrote commented Apr 5, 2018

  • Go through all tutorials and note down all bugs
  • Go through reference manual and note down all bugs and errors
    • including installation/dependency bugs
  • Fix them
@ax3l
Copy link
Contributor

ax3l commented Apr 12, 2018

Added installation/dependency bugs. The first impression and hurdles during a first try decide about the acceptance/success/spread of a project.

I am thinking about workflows like: quick-start with a container, one-line installation with e.g. spack, simple and well-running examples, maybe mybinder "try it online" versions. We need to check if they are automated as much as possible (deploy) and still working as expected.

@n01r
Copy link
Contributor

n01r commented Apr 17, 2018

@rshopa
Copy link

rshopa commented Jul 11, 2019

Two bugs, one regarding PMI diagnostics (pmi_diagnostics.py), second from PlasmaXRTSCalculator example:

In[33]: import numpy as np
        import matplotlib.pyplot as plt
        %run ../simex_platform/Sources/python/ScriptCollection/DataAnalysis/pmi/pmi_diagnostics.py

  File "/mnt/home/rshopa/SIMEX/simex_platform/Sources/python/ScriptCollection/DataAnalysis/pmi/pmi_diagnostics.py", line 118
    if a_comm == 'plot-disp':
     ^
IndentationError: expected an indented block
parameters = PlasmaXRTSCalculatorParameters(
             elements=[['Be', 1, -1]],      # Stochiometry and partial charges
             photon_energy=4960.0,          # [eV]
             scattering_angle=30.0,         # [deg]
             electron_temperature=13.0,     # [eV/kB]
             electron_density=3.0e23,       # [1/cm**3]
             ion_temperature=6.0,           # [eV]
             ion_charge=2.0,
             mass_density=1.85,             # [g/cm**3]
             debye_temperature=None,
             band_gap=None,
             energy_range={'min' : -200.0,  # Min. energy/eV to calculate (relative to photon energy)
                           'max' :  200.0,  # Max. energy/eV to calculate (relative to photon energy)
                           'step':    1.0}, # Energy binning/eV.
             model_Sii='DH',                # Use Debye-Hueckel
             model_See='BMA',               # Use Born-Mermin
             model_Sbf='IA',                # Use impulse approximation
             model_IPL=0.0,                 # No ionization potential lowering.
             model_Mix=None,                # Use default (advanced mixing).
             lfc=None,                      # No local field correction.
             Sbf_norm=None,                 # No normalization of the bound-free spectrum.
             source_spectrum='GAUSS',       # Source spectrum will be taken from wavefront input.
             source_spectrum_fwhm=5,        # Not needed here.
                )
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-a36feca9ed9d> in <module>
     21              Sbf_norm=None,                 # No normalization of the bound-free spectrum.
     22              source_spectrum='GAUSS',       # Source spectrum will be taken from wavefront input.
---> 23              source_spectrum_fwhm=5,        # Not needed here.
     24                 )

~/SIMEX/simex_platform/lib/python3.6/SimEx/Parameters/PlasmaXRTSCalculatorParameters.py in __init__(self, elements, photon_energy, scattering_angle, electron_temperature, electron_density, ion_temperature, ion_charge, mass_density, debye_temperature, band_gap, energy_range, model_Sii, model_See, model_Sbf, model_IPL, model_Mix, lfc, Sbf_norm, source_spectrum, source_spectrum_fwhm, **kwargs)
    139         self.__electron_temperature = checkAndSetElectronTemperature(electron_temperature)
    140         # Set electron density, charge, and mass density depending on which input was given.
--> 141         self.__electron_density, self.__ion_charge, self.__mass_density = checkAndSetDensitiesAndCharge(electron_density, ion_charge, mass_density, elements)
    142         self.__ion_temperature   = checkAndSetIonTemperature(ion_temperature, self.electron_temperature)
    143         self.__debye_temperature = checkAndSetDebyeTemperature(debye_temperature)

~/SIMEX/simex_platform/lib/python3.6/SimEx/Parameters/PlasmaXRTSCalculatorParameters.py in checkAndSetDensitiesAndCharge(electron_density, ion_charge, mass_density, elements)
    684 
    685     if abs( electron_density / (mass_density * ion_charge * Avogadro / molar_weight) - 1. ) > 1e-4:
--> 686         raise ValueError( "Electron density, mass_density, and ion charge are not internally consistent: ne = %5.4e/cm**3, rho*Zf*NA/u= %5.4e/cm**3." % (electron_density, mass_density * ion_charge * Avogadro/molar_weight) )
    687 
    688     return electron_density, ion_charge, mass_density

ValueError: Electron density, mass_density, and ion charge are not internally consistent: ne = 3.0000e+23/cm**3, rho*Zf*NA/u= 2.4724e+23/cm**3.

@CFGrote
Copy link
Collaborator Author

CFGrote commented Jul 12, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants