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

Adding check for duplicates in add_interferometer! #18

Merged
merged 1 commit into from
Feb 14, 2024

Commits on Feb 7, 2024

  1. Adding check for duplicates in add_interferometer!

    This commit resolves #17
    add_interferometer! function has been modified to read the json file
    using JSON.parsefile directly and pass it to its method that takes as
    input a dictionary. Note that JSON.parsefile returns a Dict{String, Any}
    dictionary while OMAS.imas2dict constructs a Dict{Symbol, Any} dictionary.
    Thus after reading the josn file it is converted into a Dict{Symbol, Any}.
    Then a duplicacy check is run to ensure that new file has no channels that
    have an overlapping name or identifier. If a duplicate is found, an error
    is thrown and it recommends the user to use overwrite=true.
    
    In case of overwrite=true, the duplicate channels in existing ids are
    deletec and the new channels are added. This may change the indices of
    the channel in ids.interferometer.channel array.
    
    In case there is no duplicacy or overwrite=true with additional
    channels, the new channels are appended at the end of the
    ids.interferometer.channel array.
    
    Test cases have been expanded to cover the new functionality.
    anchal-physics committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    b926763 View commit details
    Browse the repository at this point in the history