Cloudy & Associates

  1. 03 Jun, 2022 4 commits
    • Marios Chatzikos's avatar
      Fix bugs when reading multiple tests from CLI · 273b0f98
      Marios Chatzikos authored
      The previous implementation of tests/run-unittests.sh had two bugs:
      
      First, when multiple modules (*.py) were given on the command line, only
      the first entry was being used.  Force list context on the $modules list
      variable to access all given elements.
      
      Second, when multiple packages were given (test/package/), the last
      module of the first had its name concatenated with the first of the
      second into a module that did not exist.  Iterate over package modules
      to securely form the list of modules to test.
      
      The current implementation works in both cases, and also with a mix of
      modules and packages given on the command line.
      273b0f98
    • Marios Chatzikos's avatar
      Allow test suite to work with unedited conf file · 4dd77381
      Marios Chatzikos authored
      The previous implementation was using an untracked configuration file
      that contained a valid Cloudy path.  Replacement of that file caused
      test failures.
      
      Guard against both the configuration file being unedited and containing
      an invalid Cloudy path.  Parametrize the Cloudy path used in the example
      config file as ui.config.cloudy_path_mock and use consistently in bin/
      and tests/test/.
      
      Also modify test suite to work with adm.conf instead of example.conf.
      The latter is only created by test/ui/test_config.py, the former can be
      used by all other modules, and is expected to be edited.
      4dd77381
    • Marios Chatzikos's avatar
      8feecb01
    • Marios Chatzikos's avatar
      Refactor __rm_file in a module, use from tests · b4ae0d78
      Marios Chatzikos authored
      The function was repeated in several test modules.  Refactor into module
      that all can use.
      b4ae0d78
  2. 01 Jun, 2022 1 commit
    • Marios Chatzikos's avatar
      Change 'j:' to 'h:' in output files · 555e3652
      Marios Chatzikos authored
      'j:' (joined) is confusing, unless you are reading the source script.
      'h:' (hybrid) should be more intuitive to users.
      
      This affects text files produced by visualization.  The strings appear
      in comments at the end of data lines.
      555e3652
  3. 16 May, 2022 1 commit
    • Marios Chatzikos's avatar
      Adjust symbols in wavelength comparison plots · 6073cbf0
      Marios Chatzikos authored
      With the previous implementation, the plots comparing wavelengths with
      experimental values treated all entries the same.
      
      Now, wavelengths are distinguished into those that have no theoretical
      counterparts (labeled 'Exp'), from theoretical ones that arise between
      valence levels ('Valence'), and the rest ('AI').
      
      The former are shown as a sanity check -- the final dataset should not
      mess them up.
      6073cbf0
  4. 15 May, 2022 1 commit
  5. 10 May, 2022 3 commits
  6. 09 May, 2022 3 commits
    • Marios Chatzikos's avatar
      Use consecutive level indices on exports · b0d174ee
      Marios Chatzikos authored
      With the previous implementation, level indices were guaranteed to be
      ascending, but they were not updated to the new dataset.  After a cut,
      say to exclude isolated levels, each level would retain its index, so
      on output, e.g., in a .nrg file, level index 40 could be followed by 43,
      assuming levels 41 and 42 were isolated, and therefore excluded.
      
      Now level indices are consecutive integers, under any applied cut.
      
      One implication of this is that the same level may have different
      indices in different cuts of the same initial dataset.
      
      Also eliminated infrastructure in adm-export-stout.py for printing out
      excluded datalines to output files.  They were previously disabled.
      
      Infrastructure that could be removed remains in
      adm.stout.files.FileSections.
      b0d174ee
    • Marios Chatzikos's avatar
      Change CollisionBlock.insert_collision interface · e5b11bcf
      Marios Chatzikos authored
      Add lower level and upper level indices to the method interface.
      
      In the previous implementation, the indices and the collider type were
      drawn from the object that was passed to the method.  The collider is
      not added to the interface because it cannot change; it is still drawn
      from the object.
      
      The aim is to simplify updating the level indices.  It will prove useful
      with exporting scripts.
      
      Now this interface is similar to that of TranList.insert_transition.
      e5b11bcf
    • Marios Chatzikos's avatar
      Move updates of indices from export to finalize · 701f9d7e
      Marios Chatzikos authored
      In the previous implementation, both export scripts were updating the
      indices of the final dataset before producing their output.  It makes
      more sense to move these operations to adm-finalize.py.
      
      Update manual to explain the purpose of these updates in the description
      of adm-finalize.py
      701f9d7e
  7. 08 May, 2022 11 commits
    • Marios Chatzikos's avatar
      Fix bug with NIST notes in adm-export-stout.py · a32ffab8
      Marios Chatzikos authored
      With the previous implementation, all NIST notes were reported in the
      .nrg, even for excluded levels (--noai and/or --noisol).  Now excluded
      levels are accounted for when compiling list of NIST notes.
      a32ffab8
    • Marios Chatzikos's avatar
      Let user control stack on abort with config file · 1d216b80
      Marios Chatzikos authored
      Printing the call stack on an abort initiated by ADM is useful during
      development, but could be a nuisance to users. Switch it off by default.
      
      Make use of the SHOW_STACK_ON_ABORT option in the configuration file to
      control whether the call stack is printed on an ADM abort.  Unhandled
      exceptions are not affected by this (the call stack is still reported).
      
      Update all scripts to use this facility.  If the config file does not
      exist, it is not parsed and the default option for the stack is used
      (off).
      1d216b80
    • Marios Chatzikos's avatar
      64378741
    • Marios Chatzikos's avatar
      Change the input lines of config files · 3981efe3
      Marios Chatzikos authored
      Turn all keywords to all caps, and use '=' as a data separator.  This
      should inhibit errors like not picking up the entire input, as it did
      with the user name.
      
      Remove tests/example.conf -- instead, create it on the fly, and use it
      with unit testing.
      3981efe3
    • Marios Chatzikos's avatar
      185582c8
    • Marios Chatzikos's avatar
      Fix bug with reading user in config file · 4e3bb7ba
      Marios Chatzikos authored
      The previous implementation used only the first word of data in the
      'user' field of the configuration file as the name.  Now the entire
      input is used.
      4e3bb7ba
    • Marios Chatzikos's avatar
      Modify ConfFile.parse to use default filename · 27532343
      Marios Chatzikos authored
      It is unnecassary to require a file name for the configuration file; ADM
      should operate only on the default.  Parameter 'cfile' turned to keyword
      argument (made optional).
      
      Also simplified logic of post-processing Cloudy path, and renamed
      'resolve' keyword to 'validate_cloudy'.  Useful only for unit testing.
      
      Add default configuration file tests/example.conf, or the unit test
      will fail.
      27532343
    • Marios Chatzikos's avatar
      Set some properties of PDF manual · e22d7743
      Marios Chatzikos authored
      e22d7743
    • Marios Chatzikos's avatar
      Refer to isolated levels, not connected · e3766d70
      Marios Chatzikos authored
      With the previous infrastructure, levels were marked as 'connected' if
      they participated in any transitions.  Marking them as isolated is far
      more intuitive.
      e3766d70
    • Marios Chatzikos's avatar
      Disable writing excluded lines in .nrg files · 1d58e0d3
      Marios Chatzikos authored
      These extra levels, enclosed within two 'fields of stars' lines should
      be confusing to users of the data, and they are anyway useless.
      
      Disable them in adm-export-stout.py for now.
      
      Consider deprecating and then removing the relevant infrastructure in
      stout.files.FileSections.
      1d58e0d3
    • Marios Chatzikos's avatar
      Change WL scatter file names to be like others · 77a61d59
      Marios Chatzikos authored
      Output files used strings such as 'matched_levels', while all other
      files use 'registered_levels' instead.  Updated these labels in function
      adm.register.trans.prepare_WL_scatter_data, where they are set.
      
      Also updated the manual, both TeX and names of files used.
      77a61d59
  8. 07 May, 2022 2 commits
    • Marios Chatzikos's avatar
      Add hybrid energy column to registration summary · 36f7daea
      Marios Chatzikos authored
      Make it easier to tell if adjacent levels/terms have flipped.
      36f7daea
    • Marios Chatzikos's avatar
      Let Energies.index_for_level handle duplicates · fb095348
      Marios Chatzikos authored
      ADAS omits the ancestry terms from its configurations.  It so happens
      (e.g., Be+) that duplicate levels may exist, having identical names;
      these usually show up as overpopulated terms.
      
      With the previous implementation, Energies.index_for_level reported the
      index of the first matching name.  Now it returns a list of indices for
      all levels with matching names.
      
      This change cascades, and affects the behavior of other functions and
      scripts:
      
      - convert.theory_level_to_experm_index now returns a list.  Called from
        adm-inspect.py, option 'ld' now shows the details of all matching
        levels, not just the first one matching a given name.
      
      - merge.copy_experm_levels reported the first level in the hybrid
        dataset that matched an experimental name.  Now it returns the first
        that is not registered (with either level or term), so adm-merge.py
        reports the right level when it announces that an experimental level
        already exists in the hybrid set.  Obviously, this is innocuous,
        since the experimental level would not be entered anyway, but it is
        good to keep the log sane.
      
        merge.indices_for_experm_term is likewise affected.
      
      - shifts.get_transition_bounds now returns a list of tuples, instead of
        a single tuple.  These are assembled from all the transitions an
        unregistered level may be involved in.  These are anyway compiled into
        a list by shifts.get_transition_bounds, so there is no cascade of
        changes.  The results of adm-shift-unreg-terms.py invoked with the
        --tnick option are influenced.  (NB NB this has not been tested.)
      fb095348
  9. 05 May, 2022 1 commit
    • Marios Chatzikos's avatar
      Add statistics menu options to adm-inspect.py · bd0515a3
      Marios Chatzikos authored
      This changeset was conceived as a means of comparing the properties of
      different shifting methods in the registration of Be+, but obviously it
      can be used with any atomic models.
      
      It allows calculating the RMS of residuals for various datasets.  TP and
      branching ratios are currently implemented, and various cuts of these
      datasets are considered.
      
      Comparison of the RMS of homologous datasets should aid with selecting
      one model out of those considered.
      bd0515a3
  10. 03 May, 2022 6 commits
    • Marios Chatzikos's avatar
      Improve interface of adm-shift_unregistered_terms · f2d3a1d9
      Marios Chatzikos authored
      For each term, the code shows a number of terms both below and above the
      one to be shifted, each with their original and hybrid energies.
      
      As it is, users have to do some calculations to compare the suggested
      shifts with those of the neighboring terms.
      
      Add to that output the energy difference, and the fractional change.
      Show in bold.
      
      Also show in the same format the suggested energy shift for each metric.
      f2d3a1d9
    • Marios Chatzikos's avatar
      a4cdd4d7
    • Marios Chatzikos's avatar
      Increment commit message limits, for newline · 585c7389
      Marios Chatzikos authored
      Bash function check_style uses wc to count the length of the header line
      and the longest line in the file.  However, wc includes newlines in its
      counts, while the hardcoded limits do not.  Adjusted here.
      585c7389
    • Marios Chatzikos's avatar
      Fix bug in automated shifting & missing term above · 951d8d75
      Marios Chatzikos authored
      With the previous implementation, adm-shift-unreg-terms.py options 't'
      and 'r' led to crashes when the term to be shifted was not bracketed
      from above.
      
      The strategy now used in such cases is:
      
      - Option 't' minimizes changes to the total Einstein A a term's levels
        are involved in, both to lower and from upper levels.  Absent
        registered upper terms, it is reasonable to use only transitions to
        lower levels instead, option 'l' (for level lifetimes).
      
      - Option 'r' maintains the relative spacing with the bracketing terms.
        Absent registered upper terms, it is sufficient to use instead option
        'c' (for constant spacing to the nearest lower term).
      951d8d75
    • Marios Chatzikos's avatar
      Add checks on commit message structure · 18e7395f
      Marios Chatzikos authored
      18e7395f
    • Marios Chatzikos's avatar
      Automate shifting of unregistered terms · 7699fd99
      Marios Chatzikos authored
      I am moving toward a workflow where the best atomic model is chosen
      among a number produced with different shifting methods applied to all
      terms consistently.
      
      This is now done via a command-line switch to adm-shift-unreg-terms.py.
      
      Automating this process guarantees that all terms be treated the same in
      each run, and also makes execution much more efficient.
      
      The key implementation choice is that adm.ui.upr.__get_user_input is
      modified to allow overriding user input acquisition with a preselected
      text.
      
      This design choice guarantees that the output produced be identical to
      that produced by an equivalent run of manual input entry.
      7699fd99
  11. 02 May, 2022 1 commit
    • Marios Chatzikos's avatar
      Fix bug with ambiguous terms in reg. summary · 8e8dfda1
      Marios Chatzikos authored
      In the previous implementation, shifted terms were identified using
      their indices in addition to their configuration and term, but the
      retrieval of the experimental levels they were shifted did not use their
      indices.
      
      In cases such as in Be+, where some ADAS terms had to be split in two
      groups of terms (because it does not include ancestry terms), this
      resulted in the first group being reported instead of the second, i.e.,
      in unregistered terms being reported as registered.
      
      Supply indices in call to ConfTerms.shifted_with to disambiguate groups.
      8e8dfda1
  12. 01 May, 2022 6 commits