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

Modified the isisVarInit.py script #3945

Merged
merged 3 commits into from
Jul 27, 2020
Merged

Modified the isisVarInit.py script #3945

merged 3 commits into from
Jul 27, 2020

Conversation

rbeyer
Copy link
Contributor

@rbeyer rbeyer commented Jul 8, 2020

Description

  • Removed the '3' from its filename
  • Altered so that it writes out isis-activate.* and isis-deactivate.* files instead of the generic env_vars.* filenames.
  • Removed the the tremendous amount of leading whitespace written to the files.
  • Add a report of the version information on conda activation. Purely cosmetic.
  • General code cleanup.
  • Also changes the name of the script in the README instructions.

Related Issue

Motivation and Context

I couldn't stand all the leading spaces, and since I was in the code already, I also addressed the above issues.

How Has This Been Tested?

I copied this script into the $CONDA_PREFIX/scripts/ directory of a ISIS 4.1.0 environment, and it seemed to do all the right things in my zsh shell, but did not test csh or fish.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read and agree to abide by the Code of Conduct. Can't check, this URL is still 404ing!
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

rbeyer added 2 commits July 7, 2020 17:09
internally, and made it write out isis-activate.* and isis_deactivate.*
files.
csh = dict(
extension=".csh",
shebang="#!/usr/bin/env csh",
activate="setenv {}={}",
Copy link
Contributor

Choose a reason for hiding this comment

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

setenv doesn't use an =, this should be setenv {} {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I did mention that I didn't test it.



def mkdir(p: Path):
# This just wraps and reports on the directory creation:
Copy link
Contributor

Choose a reason for hiding this comment

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

Convert this to a proper doc-string to match the other helper functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did. I also altered this to return a string instead of None. I don't like functions calling print() (unless I'm debugging).

and to return a string (only main should print(), functions shouldn't or
should log, but that's overkill for this).
@rbeyer rbeyer requested a review from jessemapel July 27, 2020 18:19
@jessemapel jessemapel merged commit d1ed1cb into DOI-USGS:dev Jul 27, 2020
@rbeyer rbeyer deleted the isisVarInit branch July 27, 2020 18:31
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.

Potential problem: name of env_vars conda script Add automatic env setup for multiple conda envs
2 participants