Skip to content
Snippets Groups Projects
  1. Jun 09, 2024
  2. Nov 22, 2023
  3. Oct 06, 2023
  4. Aug 01, 2023
  5. Jun 30, 2023
  6. Jun 23, 2023
  7. Jun 21, 2023
  8. May 05, 2023
  9. Mar 31, 2023
  10. Mar 14, 2023
  11. Mar 08, 2023
  12. Feb 02, 2023
  13. Jan 06, 2023
  14. Jan 04, 2023
  15. May 25, 2022
  16. May 13, 2022
  17. Apr 20, 2022
  18. Apr 13, 2022
    • Wuttke, Joachim's avatar
      d322d986
    • Wuttke, Joachim's avatar
      corr · 15644d14
      Wuttke, Joachim authored
      15644d14
    • Wuttke, Joachim's avatar
      auto update many examples; many tests broken · a4920b13
      Wuttke, Joachim authored
      def user_edit(fn, t):
      
          t = re.sub(r'def get_simulation\(sample\):',
                     'def get_simulation(sample, **simargs):', t)
      
          N = 0
          xx = r'\n((\s+?)\w+ = ba\.\w+?Detector)\((\d+), (.+?, .+?), \d+, (.+?, .+?)\)'
          m = re.search(xx, t)
          if m:
              N = int(m.group(3))
          t = re.sub(xx, r"\n\2n = simargs['n']\n\1(n, \4, n, \5)", t)
      
          xx = r'(\w+ = ba\.\w+?Detector)\((\d+), (.+?, .+?, .+?)\)'
          m = re.search(xx, t)
          if m:
              N = int(m.group(2))
          t = re.sub(xx, r"\1(simargs['n'], \3)", t)
      
          xx = r"(if __name__ == '__main__':\n)((.*?\n)+?)(\s+\w+ = get_simulation\(\w+)\)\n((.*?\n)*?)\s+bp\.plot_simulation_result\(simulation\.simulate\(\)\)"
          t = re.sub(xx, r"\1" +
                     "    plotargs, simargs = bp.kwargs_from_cmdline(sim_n=" + str(N) + ")\n" +
                     r"\2" +
                     r"\4, **simargs)\n"
                     r"\5" +
                     "    result = simulation.simulate()\n" +
                     "    bp.plot_simulation_result(result, **plotargs)", t)
      
          return t
      a4920b13
  19. Apr 08, 2022
  20. Sep 22, 2021
  21. Aug 03, 2021
  22. Aug 02, 2021
  23. May 25, 2021
    • Ammar Nejati's avatar
      Correct the Python import statements · 6a2c7476
      Ammar Nejati authored
      The addition of the path of `BA/Wrap/Python/__init__.py` to `os.path`
      is _not_ necessary anymore.
      
      The import statements need to be changed:
      ```
      import ba_plot -> from bornagain import ba_plot
      import ba_fitmonitor -> from bornagain import ba_fitmonitor
      ```
      
      The root-path of the project is correctly set in the shell script
      `thisbornagain.sh`.
      
      Consult e.g. "The Definitive Guide to Python import Statements" <https://chrisyeh96.github.io/2017/08/08/definitive-guide-python-imports.html>
      
      Tested under Debian Buster, Python 3.7.3.
      
      Resolves issue #1198
      6a2c7476
  24. May 03, 2021
  25. Apr 19, 2021
  26. Mar 14, 2021
  27. Mar 07, 2021
Loading