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

2164 update config from list of variables to class #2168

Merged
merged 88 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
ad96e57
Draft of config class
lucas-wilkins Aug 19, 2022
2e9a9a1
Initial part of migration to temporary config
lucas-wilkins Aug 19, 2022
f0a0e95
Merge branch 'main' into 2164-update-config-from-list-of-variables-to…
lucas-wilkins Aug 19, 2022
2dd219b
Reverted file name
lucas-wilkins Aug 19, 2022
64d6659
Some migration to config object
lucas-wilkins Aug 19, 2022
32d2ab1
More migration
lucas-wilkins Aug 19, 2022
a5962b5
Undid erronious substitutions: config -> config_system
lucas-wilkins Aug 31, 2022
b04b370
Added tempory package to setup.py
lucas-wilkins Aug 31, 2022
19b3fd6
Removed local_config.py
lucas-wilkins Aug 31, 2022
d455208
Merge branch 'main' into 2164-update-config-from-list-of-variables-to…
lucas-wilkins Aug 31, 2022
1dc5e60
Removed some references to local_config.py
lucas-wilkins Aug 31, 2022
7047c29
Removed custom_config.py
lucas-wilkins Aug 31, 2022
314e93d
Removed custom_config from spec
lucas-wilkins Aug 31, 2022
b490e5c
Replaced references to custom_config
lucas-wilkins Aug 31, 2022
2e3ba48
Adding schema system to config
lucas-wilkins Sep 1, 2022
a7578e4
Unit tests for config class, start of load/save
lucas-wilkins Sep 2, 2022
eb93ad1
load and save implemented, tests pass
lucas-wilkins Sep 2, 2022
3b4566c
Config saved to config.json on exit, a decision needs to be made abou…
lucas-wilkins Sep 2, 2022
96b1dee
Fixed issue with test values that should be different for defaults no…
lucas-wilkins Sep 2, 2022
c2d028a
Used config copies in config, not the main config item as this appear…
lucas-wilkins Sep 2, 2022
3081952
Merge branch 'main' into 2164-update-config-from-list-of-variables-to…
lucas-wilkins Sep 12, 2022
41fed40
Removed installer_generator files
lucas-wilkins Sep 12, 2022
a32de61
Removed another local config
lucas-wilkins Sep 12, 2022
6fe1f67
Removed unused text from config
lucas-wilkins Sep 12, 2022
6b7d9ef
Preparing for migration of urls
lucas-wilkins Sep 12, 2022
906ec91
Removed unused methods from __init__
lucas-wilkins Sep 12, 2022
a2c7602
Introduced url container
lucas-wilkins Sep 12, 2022
6182c35
Factored out urls
lucas-wilkins Sep 12, 2022
7f63860
More deletions of unused fields
lucas-wilkins Sep 12, 2022
0b95f6a
Removed more unused fields from config
lucas-wilkins Sep 12, 2022
63d2a49
Removed yet more fields from config
lucas-wilkins Sep 12, 2022
351359d
Moved more urls out of config
lucas-wilkins Sep 12, 2022
d68dc07
More notes in config
lucas-wilkins Sep 12, 2022
ed5ab90
Removed more stuff from config
lucas-wilkins Sep 12, 2022
b11146e
Removed printEVT
lucas-wilkins Sep 12, 2022
86b8745
Config loading and saving properly implemented
lucas-wilkins Sep 12, 2022
85b300e
Removed some more things
lucas-wilkins Sep 12, 2022
72680b9
GuiUtils now duplicates variables, removing some
lucas-wilkins Sep 12, 2022
de53a08
Removed unused splash screen params from GuiUtils
lucas-wilkins Sep 12, 2022
4ad188f
Removed more GuiUtil duplicates
lucas-wilkins Sep 12, 2022
533d08f
Removed more unused variables from GuiUtils
lucas-wilkins Sep 12, 2022
7f6d833
Removed more GuiUtil things, and some references to it from DataExplorer
lucas-wilkins Sep 12, 2022
d9650e7
Fixed test
lucas-wilkins Sep 13, 2022
97cd81d
Deleted _config
lucas-wilkins Sep 13, 2022
19af85e
Removed unused config variables
lucas-wilkins Sep 13, 2022
36ed14d
Removed more unused config items
lucas-wilkins Sep 13, 2022
4b7ec88
Removed further config items
lucas-wilkins Sep 13, 2022
11a1ef2
Moved some packages, started on environment variable interface
lucas-wilkins Sep 13, 2022
3a755d0
Updated config variables
lucas-wilkins Sep 14, 2022
fe81a7f
Removing old config, adjusting CL state representation
lucas-wilkins Sep 14, 2022
8d91a0b
GPU settings updated
lucas-wilkins Sep 14, 2022
fe8fb8f
Disabled test flag to see if it breaks anything
lucas-wilkins Sep 14, 2022
bffd910
Fixed file references for moved files
lucas-wilkins Sep 14, 2022
658f2fa
Moved config_system to system.config
lucas-wilkins Sep 14, 2022
77d4a00
Tweaked config layout and updated setup.py
lucas-wilkins Sep 14, 2022
d908dbc
Changed bad package name
lucas-wilkins Sep 14, 2022
741febe
Fixed bad imports in utest
lucas-wilkins Sep 14, 2022
e3c41e0
Updated .gitignore to miss config.json
lucas-wilkins Sep 14, 2022
0c9fba3
Cleaned up __init__s, made user, version, and zenodo files in system
lucas-wilkins Sep 15, 2022
c18428a
Update release automation script for new structure
lucas-wilkins Sep 15, 2022
93cb3bc
Removed commented datas
lucas-wilkins Sep 15, 2022
db8ef64
Cleaning up GuiUtils
lucas-wilkins Sep 15, 2022
92da71d
Cleaned some of GuiUtils and removed more config entries
lucas-wilkins Sep 15, 2022
c9a070d
Removed CustomDir.py
lucas-wilkins Sep 15, 2022
4780943
Update web links
lucas-wilkins Sep 15, 2022
b7a6b2e
Fixed build number issues
lucas-wilkins Sep 15, 2022
69d1d95
Fixed version location in setup
lucas-wilkins Sep 15, 2022
6b6527a
Removed hide toolbar text
lucas-wilkins Sep 16, 2022
7ca5d50
Fixed version
lucas-wilkins Sep 26, 2022
576eacc
Delft URL
lucas-wilkins Sep 26, 2022
6656884
Moved sas.system.user import
lucas-wilkins Sep 26, 2022
38957fe
Changed import again
lucas-wilkins Sep 26, 2022
ea5ce84
Removed strict version requirement - isn't really necessary
lucas-wilkins Sep 26, 2022
a6f2339
Attempt to fix images issue
lucas-wilkins Sep 26, 2022
0323f5f
Rename web._licence to something not totally weird
lucas-wilkins Sep 28, 2022
488540b
__version__ import fix
lucas-wilkins Sep 28, 2022
f26c4bc
Changed version import
lucas-wilkins Sep 28, 2022
5b172b8
Weaker config requirements, pretty print
lucas-wilkins Oct 10, 2022
554567f
Removed config entries from logger
lucas-wilkins Oct 10, 2022
a40fe84
Merge branch 'main' into 2164-update-config-from-list-of-variables-to…
lucas-wilkins Oct 10, 2022
728e210
Bugfix
lucas-wilkins Oct 10, 2022
9e8f789
Save to user dir
lucas-wilkins Oct 10, 2022
45ad22a
Updated utest to reflect change in logging level
lucas-wilkins Oct 10, 2022
d06a9f0
Removed debugging print statement
lucas-wilkins Oct 10, 2022
2640c0f
Merge branch 'main' into 2164-update-config-from-list-of-variables-to…
lucas-wilkins Oct 10, 2022
74bbe12
Updated web links to https
lucas-wilkins Oct 11, 2022
db897fb
Updated MainWindow config-env stuff
lucas-wilkins Oct 12, 2022
cb5c058
Merge branch 'main' into 2164-update-config-from-list-of-variables-to…
lucas-wilkins Oct 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
run: |
# SET SASVIEW GITHASH
githash=$( git rev-parse HEAD )
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/sasview/__init__.py
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/system/version.py
# BUILD SASVIEW
python setup.py clean
python setup.py build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
run: |
# SET SASVIEW GITHASH
githash=$( git rev-parse HEAD )
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/sasview/__init__.py
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/system/version.py
# BUILD SASVIEW
python setup.py clean
python setup.py build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
run: |
# SET SASVIEW GITHASH
githash=$( git rev-parse HEAD )
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/sasview/__init__.py
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/system/version.py
# BUILD SASVIEW
python setup.py clean
python setup.py build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
run: |
# SET SASVIEW GITHASH
githash=$( git rev-parse HEAD )
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/sasview/__init__.py
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/system/version.py
# BUILD SASVIEW
python setup.py clean
python setup.py build
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*.so
*.exe

/.vagrant
/build
/dist
sasview.egg-info
Expand All @@ -39,6 +38,7 @@ default_categories.json
/setup.cfg
**/UI/*.py
!**/UI/__init__.py
config.json

# doc build
/docs/sphinx-docs/build
Expand Down
38 changes: 20 additions & 18 deletions build_tools/release_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,29 +135,31 @@ def generate_zenodo(sasview_data, zenodo_api_key):
"and attach to Zenodo release record.\n- Publish Zenodo record")
return newDOI

def update_sasview_init(version, doi):
"""
version_template = \
"""
__version__ = "%s"
__release_date__ = "%i"
__build__ = "GIT_COMMIT"
"""
lucas-wilkins marked this conversation as resolved.
Show resolved Hide resolved

:return:
zenodo_template = '__DOI__ = "%s"'

def update_sasview_metadata(version, doi):
"""
Update version and zenodo DOI
"""

init_file = os.path.join('sasview','src', 'sas', 'sasview', '__init__.py')
output_lines = []
system_directory = "sasview/src/sas/system"
version_filename = os.path.join(system_directory, "version.py")
zenodo_filename = os.path.join(system_directory, "zenodo.py")
lucas-wilkins marked this conversation as resolved.
Show resolved Hide resolved

year = datetime.datetime.now().year
with open(init_file, 'r') as f:
for line in f.readlines():
if line[:11] in '__version__':
output_lines.append('__version__ = \"'+version+'\"\n')
elif line[:7] in '__DOI__' :
output_lines.append('__DOI__ = \"Zenodo, ' + str(doi) + '\"\n')
elif line[:16] in '__release_date__':
output_lines.append('__release_date__ = \"' + str(year) + '\"\n')
else:
output_lines.append(line)

with open(init_file, 'w') as f:
f.writelines(output_lines)
with open(version_filename, 'w') as file:
file.write(version_template % (version, year))

with open(zenodo_filename, 'w') as file:
file.write(zenodo_template % doi)

def update_sasmodels_init(version):
"""
Expand Down Expand Up @@ -241,7 +243,7 @@ def prepare_release_notes(issues_list, repository, username, password):
zenodo_api_key = args.zenodo
new_doi = generate_zenodo(sasview_data, zenodo_api_key)

update_sasview_init(sasview_version, new_doi)
update_sasview_metadata(sasview_version, new_doi)
update_sasmodels_init(sasmodels_version)

year = datetime.datetime.now().year
Expand Down
1 change: 1 addition & 0 deletions build_tools/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ html5lib
importlib-resources
bumps
html2text
jsonschema
1 change: 0 additions & 1 deletion docs/sphinx-docs/source/_extensions/mathjax.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def setup(app):
app.add_config_value('mathjax_path',
'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?'
'config=TeX-MML-AM_CHTML',
#'config=TeX-AMS-MML_HTMLorMML',
False)
app.add_config_value('mathjax_css', None, 'html')
app.add_config_value('mathjax_use_katex', False, 'html')
Expand Down
Loading