-
Notifications
You must be signed in to change notification settings - Fork 0
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
NEW: restructure using a python module/library instead of one big file #16
Milestone
Comments
Simultaneously, we could also remove all the global variables and replace them with arguments and return values in the functions. |
Scripts are uploaded in lucienneMicallef Branch | src Major update:
Other updates to scriptMK.py
Functions removed: |
lmicallef
added a commit
that referenced
this issue
Oct 16, 2020
Updated Code: Major update: - Script has been divided into two: - I) storing all functions (scriptMK.py) - ii) the main programme (mkReadme.py) - Script should be stored in an experiment, hence all reference being made to scripts stored in the root have been removed Other updates to scriptMK.py - Lines 612 - 618: reverted to the original path configuration, I.e. currentDirectory. open("../../cfg.txt", "r") etc.. is not working correctly - Line 739 did not work, I have reverted to the previous code - Reference to input.def is changed to input.ini - Function to generate the markdown table from input.def has been removed - Library local.svn is removed - Subprocess.CalledProcessError is used as exception handling for SVN - Code commented and not being used has been removed - Removed unused variables - Removed pycurl module Functions removed: main() chooseConfigFile() check_EXPref()
lmicallef
added a commit
that referenced
this issue
Nov 9, 2020
Updated Code: Major update: The script which contains all the functions (scriptMK_v5.py) has been organised in two classes. One is color and the other is readmeScript. Color Class contains all the inbuild colours which are being used in the script. readmeScript Class contains an initialisation class (similar to a constructor) which stores attributes that will be used for several methods in this same class. All global variables have been removed and where possible variables are being passed as arguments. The main script (mkReadme_v5.py) imports the above classes and creates instances to be able to access the attributes and methods. The above changes were made (i) to avoid global variables (ii) to to have an object-oriented approach to faciliate work when we need to create a package. P.S. These scripts are still work in progress and script names can be changed
lmicallef
added a commit
that referenced
this issue
Dec 3, 2020
Major Updates: ScriptMK.py is divided into two classes (this will be useful when the library will be implemented): - Color (stores the colours used during the execution of the script) - ReadmeScript: this class stores all the functions necessary to generate the Readme template. - Global variables have been removed and replaced by arguments. - The code includes reference to ‘REF’ mkReadme.py the main update is that instances for the classes mentioned above were declared.
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Currently, the mkReadme script is a monolith. This makes it less re-usable for other developments (or our own).
A better approach would be a module/library, that can be easily imported.
Proposed Solution
Split the mkReadme script into two parts: one module and one 'executable' which imports the module.
Ultimate goal: nemo-simsar can be installed via pip & co.
Relations
mkReadme
scriptThe text was updated successfully, but these errors were encountered: