-
Notifications
You must be signed in to change notification settings - Fork 506
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
Install function for custom templates, template docs update #1250
base: main
Are you sure you want to change the base?
Conversation
I wasn't sure if this can/should be tested, so I simply tested it locally on the jdaviz custom template by running: from voila.paths import install_custom_template
install_custom_template('../jdaviz', 'jdaviz-default', overwrite=True) I can confirm that the jdaviz template directories get symlinked within the correct directories, alongside voilà's "base" template dirs. |
Benchmark reportThe execution time (in milliseconds) are grouped by test file, test type and browser. Results table
❗ Test metadata have changed--- /dev/fd/63 2022-11-02 16:47:51.411622478 +0000
+++ /dev/fd/62 2022-11-02 16:47:51.411622478 +0000
@@ -4,37 +4,37 @@
"BENCHMARK_REFERENCE": "actual"
},
"browsers": {
- "chromium": "97.0.4666.0"
+ "chromium": "94.0.4595.0"
},
"systemInformation": {
"cpu": {
- "brand": "Xeon® Platinum 8272CL",
+ "brand": "Xeon® E5-2673 v3",
"cache": {
"l1d": 65536,
"l1i": 65536,
- "l2": 2097152,
- "l3": 36700160
+ "l2": 524288,
+ "l3": 31457280
},
"cores": 2,
"family": "6",
- "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear",
+ "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt md_clear",
"governor": "",
"manufacturer": "Intel®",
- "model": "85",
+ "model": "63",
"physicalCores": 2,
"processors": 1,
"revision": "",
"socket": "",
- "speed": 2.6,
+ "speed": 2.4,
"speedMax": null,
"speedMin": null,
- "stepping": "7",
+ "stepping": "2",
"vendor": "GenuineIntel",
"virtualization": false,
"voltage": ""
},
"mem": {
- "total": 7281311744
+ "total": 7291699200
},
"osInfo": {
"arch": "x64",
@@ -42,11 +42,11 @@
"codename": "Focal Fossa",
"codepage": "UTF-8",
"distro": "Ubuntu",
- "kernel": "5.15.0-1022-azure",
+ "kernel": "5.8.0-1040-azure",
"logofile": "ubuntu",
"platform": "linux",
- "release": "20.04.5 LTS",
- "serial": "1cb717add1594749b790a0e303368aa5",
+ "release": "20.04.3 LTS",
+ "serial": "cfc067bfcb844f35865e279a1b0e66c5",
"servicepack": "",
"uefi": false
} |
Hi @bmorris3 , the PR here looks much larger than what was needed in https://github.com/spacetelescope/jdaviz/blob/main/setup.py#L123-L164 , could you describe the large discrepancy ? Also, I am not sure why moving from setuptools to hatch doesn't allow for the current approach, I believe hatch has a good plugin system that allows custom code to be executed, like what we currently do in setup.py. Also, the reason for the change in documentation is not clear to me, I see a large portion of documentation being replaced by documentation that doesn't seem to replace it. Regards, Maarten |
Hi @maartenbreddels,
If you compare
This PR is somewhat independent from the setuptools/hatch conversation in spacetelescope/jdaviz#1729. In the related PR spacetelescope/jdaviz#1792, I outlined that the only convenient way for a developer to "install" a custom voila template is to
There's no convenient way to re-install further revisions to the custom template without repeating this process. (More details and discussion are over in that jdaviz PR.)
As pointed out in #827, it seems that the template docs are out of date. The existing documentation was contributed several years ago in #126. If you look at the file/directory structure explained in the voila docs, you'll see it's out of sync with the structure in the voila source code. I've spent some time attempting the git archaeology to sort out how/when this happened, but I haven't found the PR. In this PR, I've simply removed the section on custom templates, which is no longer accurate. I would contribute corrected docs in their place, but I don't think I am qualified to write out what voila expects. Thanks! |
References
This PR addresses #827, as well as spacetelescope/jdaviz#1729.
Code changes
This PR introduces a convenience function for installing custom templates, called
install_custom_template
. A user specifies a path to a custom template's directory structure and the name of the custom template. The custom template is then symlinked (preferred) or copied (fallback option) to the same directory where the voilabase
template is located. By default, this function does not overwrite existing templates. Also by default,install_custom_template
will ignore anyshare/
dirs in the current working directory (so if you runinstall_custom_template
in your localvoila
repo, it won't install your custom template in the voila repo'sshare/
dir.Background: this PR was motivated by work on spacetelescope/jdaviz#1729. jdaviz, among other tools, contains a custom voilà template which gets installed with the package. We had to carefully symlink or copy the template files from within our
setup.py
in order to make the jdaviz custom template available for voilà. In spacetelescope/jdaviz#1792 I developed the functions in this PR, and we realized they might belong upstream in voilà. If this PR is merged, it supersedes spacetelescope/jdaviz#1792.User-facing changes
I've edited the custom template docs page, mostly by removing out-of-date content and mentioning the new function.
Backwards-incompatible changes
None.