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

Facility to provide per-setup atom data as well as save report locally. #653

Merged
merged 4 commits into from
Aug 22, 2016

Conversation

kdexd
Copy link

@kdexd kdexd commented Aug 19, 2016

This PR focuses on adding flexibility to current integration testing infrastructure.

Facility for Atom Data files;

  • Till now only one atom data file ( generally kurucz_cd23_chianti_H_He.h5 ) could be provided using the --atomic-dataset flag. Instead of this, the integration tests can now use the atom data file specified in the YAML config of a particular setup used for integration tests (in the sub directories of tardis/tests/integration_tests ).
  • The user has to put all the atom data files specified in config files of various setups in one directory and provide the directory path in integration tests YAML config file. Alternatively, these files can be served at a URL and that URL can also be provided.
  • The block schema in integration tests YAML config file looks like this:
atom_data:
    fetch: "local" # has two choices: "local" or "remote"
    url: "http://urlservingfiles.com"
    dirpath: "/path/to/directory"
  • If fetch is set to local, then files will be taken from dirpath and url field will be ignored. Even writing it in isn't necessary in those cases. It will be the opposite case if fetch: "remote".
  • Example of URL serving atom data files: http://opensupernova.org/~karandesai96/atom_data

Local saving of report:

  • The HTML report of integration tests was uploaded on a dokuwiki instance before now. This PR lets the user generate a report locally and view it in the browser.
  • The block schema in integration tests YAML config file looks like this:
report:
    save_mode: "local" # has two choices: "local" or "remote"
    dokuwiki:
        url: "http://dokuwikiurl.com"
        username: "your_username"
        password: "your_password"
    dirpath: "/path/to/directory"
  • If save_mode is set to local, then files will be taken from dirpath and dokuwiki section will be ignored. Even writing it in isn't necessary in those cases. It will be the opposite case if save_mode: "remote".

NOTE:

  • Do add astropy's --remote-data flag as argument.

)
else:
# If the atom data is to be ingested from local file:
atom_data_filepath = "{dirpath}/{name}".format(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use os.path.join instead of string formatting for the filepath.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, mimicked from above block 😅

@yeganer
Copy link
Contributor

yeganer commented Aug 19, 2016

Thanks for this PR, it should solve the problem.

The way I imagined the fix would have been adding this functionality directly to tardis by adding an optional parameter to the config yml (url: True for example). If this is set the configuration would do the work.

But for now having this functionality exclusive to the integration tests is fine, too.

@kdexd kdexd force-pushed the atom-data-and-report-local branch from 8d8de89 to fa0e610 Compare August 19, 2016 14:01
@kdexd kdexd force-pushed the atom-data-and-report-local branch from fa0e610 to ee320fe Compare August 20, 2016 08:38
@wkerzendorf wkerzendorf merged commit 3c90f9d into tardis-sn:master Aug 22, 2016
@kdexd kdexd deleted the atom-data-and-report-local branch August 22, 2016 17:35
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

Successfully merging this pull request may close these issues.

3 participants