-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor configs #54
Refactor configs #54
Changes from all commits
2b644ca
7db5cd8
997e9a0
36d0cd7
a77595a
0b720ea
5bdee3a
2ad7c8a
1b0982b
768a828
a6ba7f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defaults: | ||
- stac: demo | ||
- model: rodent | ||
- _self_ | ||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,30 @@ | ||||||||||||||||||||||||||||||
"""CLI script for running rodent skeletal registration""" | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
import logging | ||||||||||||||||||||||||||||||
import hydra | ||||||||||||||||||||||||||||||
from omegaconf import DictConfig, OmegaConf | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
import stac_mjx | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
def load_and_run_stac(cfg): | ||||||||||||||||||||||||||||||
kp_data, sorted_kp_names = stac_mjx.load_data(cfg) | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
fit_path, transform_path = stac_mjx.run_stac(cfg, kp_data, sorted_kp_names) | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
logging.info( | ||||||||||||||||||||||||||||||
f"Run complete. \n fit path: {fit_path} \n transform path: {transform_path}" | ||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||
Comment on lines
+10
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check the logging format, partner. Y'all got a nice logging statement here, but consider using structured logging instead of f-string for better scalability and filtering in production environments. Here's a tweak for ya: - logging.info(
- f"Run complete. \n fit path: {fit_path} \n transform path: {transform_path}"
- )
+ logging.info("Run complete.", extra={'fit_path': fit_path, 'transform_path': transform_path}) Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
@hydra.main(config_path="./configs", config_name="config", version_base=None) | ||||||||||||||||||||||||||||||
def hydra_entry(cfg: DictConfig): | ||||||||||||||||||||||||||||||
logging.info(f"cfg: {OmegaConf.to_yaml(cfg)}") | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
stac_mjx.enable_xla_flags() | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
load_and_run_stac(cfg) | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
if __name__ == "__main__": | ||||||||||||||||||||||||||||||
hydra_entry() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configuration looks shipshape, but don't forget the newline at the end, partner.
The configuration using Hydra's features is spot on. However, it's best practice to include a newline at the end of the file to avoid any issues with version control systems or text editors that might get finicky about such things.
Add a newline at the end of the file to fix the issue flagged by yamllint:
- _self_ +
Committable suggestion
Tools
yamllint