### Example of Combined Logging Options Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/scripts/logging.rst This example demonstrates how to combine multiple logging options to control log levels, format, and output file. It sets specific loggers to DEBUG, enables long log format with a custom label, and directs output to a JSON file. ```bash butler --log-level lsst.daf.butler=DEBUG --long-log --log-label MY_ID --log-file log.json ``` -------------------------------- ### Range Literal Examples Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/queries.rst Examples demonstrating the syntax and behavior of range literals in queries. ```SQL 1..5 ``` ```SQL 1..10:3 ``` ```SQL -10..-1:2 ``` -------------------------------- ### Example of calling a subcommand with options Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst Demonstrates how to invoke a subcommand with both flag and message options. ```text $ python git.py commit -a -m "example commit message" commit. all: True, message: example commit message ``` -------------------------------- ### Example Package Hashes for Docker Source: https://github.com/lsst/daf_butler/blob/main/requirements/docker.txt This section shows a list of SHA256 hashes for various Python packages. These hashes are used to verify the integrity and exact version of each package installed in the Docker image, ensuring build reproducibility. ```text --hash=sha256:043191bfa8eab18c776647b62723ac9dddece59743b13f49b2016094129c2b3f --hash=sha256:06ca2f61ec4385a07a6977c55ba998a4466c123642b4a32694d3128fce18c079 --hash=sha256:0a041d3d761dc3c35cc56ce0351506a02bcbc25f7b169f652435141a17db9096 --hash=sha256:0ab0a9c4ffb1a6d95ef519fe4247dba8eb6b18ad93999f76b7f657039acabd47 --hash=sha256:0c9136e14ed34a9e343a31c533d78a9813a69a3148332bce5e9821cb2f996e66 --hash=sha256:110f8b71aacb688ec69062bb7f6938a0f8acb01b7c1c4beb453c65b6d234584d --hash=sha256:112b06a867b235ef466ed3508ddf0238050df9c727cafb5301ac385b899189a1 --hash=sha256:17f9ade344e7d9b464a084d69bcf18fc691cb1db67c62ed80820bf4926d78f0e --hash=sha256:1e254a00cdf42b1e4d5b3d68d33af63268d41340d8885df2ab6470f2e1500147 --hash=sha256:1e978ec1e8bd0e0e4de6bb75de9d30cbb74db6b6a2bb727618613703ca0167dd --hash=sha256:25c692919ac5a01f170a3bfcd62d745b24fd095c353d50812637d6fcab442e75 --hash=sha256:260a5d70215b61ab4fadf5c7baacd64821842975eea312125ed3c39a6391b063 --hash=sha256:2803abfebfc990042cd494d8ce2d5f82e9d847af6d35ec486923aa19dbad5e73 --hash=sha256:29a287e0cf63ff528da061de6b9f64a4618da591ca1046aafc54062e40ca7eab --hash=sha256:29cb7f67d10b479ff07c17d33e39f78c07f71c40ef30d63c153d340e96cd3fb4 --hash=sha256:3213d622a0283a39a93d188f3cf72b26862df52fbb4ca3697f51705016523d41 --hash=sha256:33111801a01c12a8a1e3721f0a9232f8cfc8ae2c6b7098167e6f623c6073f402 --hash=sha256:357cc07a6d7b0b182ff02249616a03742827ebb1277546b5c7cd7f7620a45698 --hash=sha256:38efbc8de75c7a0fc1ac190162d892787f3f47b57cc291231aafee36b80982b7 --hash=sha256:4081eb135ac24158bd51cdfbef16f1c64df7063b1143f2473138710c492bec8 --hash=sha256:40fdc1ae7125e518ea98e53e69a4ebc27e1fd50510c47b7ea130cf21e5e1d42b --hash=sha256:4cfe66903cc32a9921a6733d96b19bb6abf310397581bbad89c228f5abaf0ee8 --hash=sha256:511dbaf848decaaaf4b4ca48032619fb3138710c4bf7da7617765edad1ef96b0 --hash=sha256:55cced7c52e981362f708ad635198e97a752dfba412cc03c23bbf3bd8d5cd662 --hash=sha256:56b39e5e0622a09a25bf5baf62f4bcf0cb8a41ae6e2819cf49bbc5a74c083f91 --hash=sha256:5dbbdb29840ca3d91ee0fece42fc29278886d908280bfec0a5846c6f901a3eb0 --hash=sha256:5f9fb9157b4ce2971008323afe46053787b526ef624fea915b261468a8421a0f --hash=sha256:6180d8b35af935aed8ece3a85e0a43f87393ae0ac87c8d2c993f7270ef3 --hash=sha256:68a5124b13fa6cc2086764a20005d30bc0548146f7f5322f02fce212ca14317f --hash=sha256:68bb27509ac1b9a3443094260f6326150663b06abe40b73a2f81160623da5b67 --hash=sha256:6f41ae150c4e32db4f3310cdaf64b1593a03dbabe29eec77fc9b50fe64061df6 --hash=sha256:7265a2f3d436e54ef9f2b52b5c937e6be778781bd97a590319d7348f1c1ca997 --hash=sha256:72fbe16c6fac95aedf5937fa873445cec2110be35d8a4e9433d7501fd98dae6b --hash=sha256:7d92c3819208a60205a12a245c91ad70cb0a85336659b19b834205573ac8456e --hash=sha256:8155154c7c691289fe18f510b5d4657c68c67989f293f0535a91360392ff6538 --hash=sha256:81a1cca95ed5bb92aa8b10dd2cdc9a0d3853a50fad926c28b5d7e8ea54389627 --hash=sha256:89cd468399cfd2504718f0ba50e410dca55a170b61a02ad92bb18c8a65186e93 --hash=sha256:8ad03c0965fb3c692200e74d458ca28c1dbb4ce96f9a479a8aa041ad5fabca02 --hash=sha256:90f9849678c75fe7afa2d348ac842c168b0a4d3d61919687216dfc547976d853 --hash=sha256:948424b06129ce883307e8cff868c31396d8dc7630a59c61d70d98dbe70f222c --hash=sha256:9cd5ffd25db4e7ba6a375693b3fc0fc1791ec636c17db3720da19bde7180ec43 --hash=sha256:a0df0043bdb289bde1f62da130d20df23d58b45429f752bc7a8fc5325a225ecd --hash=sha256:a2c306dea656c12c68f51f4cea133cbe78ca7435eb28c735eac1d3ebe73be6e8 --hash=sha256:a7830bab239b79cda9c08c2da014761cafb48da6150e1da17ac06283f43b6089 --hash=sha256:a7c711e21628b52034bb5ab8d1bce291f752fcc5e92accc615778acee1ff4778 --hash=sha256:aaf159caa35993cb1f56fb9b8e4610d35758e7ca005412eb1daa856a78c9c4b1 --hash=sha256:ae506e6902902557576a26ff33eda8695e7ecb3cb36c3b573a0765dee114ebdb --hash=sha256:b507f5c4c1d508876d1819b6bf9a49d365b96320b5d4993426b33a23ca4b8261 --hash=sha256:bf162abab1c1a736333192707cef898e735a5ca00f38f27eeedf44b39d9e85eb --hash=sha256:c1a2af6c6ef86344a6b0db6b97834208bf598db514f2b155042439b62605601a --hash=sha256:c2d37ab77531417474168eb79d6d80b14f821a966818505d03013d0833edb7a8 --hash=sha256:c4fc99836233ea196540b17ab0983aff60ed07941751930f5f4d05bc3b3b7359 --hash=sha256:d581b735e177fdcdce6fed8e7e8880a3fb6ee4e3653a3ac6af01c6f4c03effc5 --hash=sha256:d6da64deb6b8ed903e7560180a92f2d804ee1ba5eeb849ac2748b8c1aba1f6d7 --hash=sha256:d8e8286dd7cea7895157318d1b91cdacac64c479f3cbc8dce548331728484751 --hash=sha256:ddea102b48f9e339f3948bf22040944184627a30fdf7f858667673b9c5f033c8 --hash=sha256:dfa20cc6ca228e6b155b11da03825975ce66aea520985dbbddf0f2a5a495c605 ``` -------------------------------- ### YAML Options File Example Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/scripts/options-file.rst Define default options for butler subcommands in a YAML file. Options are grouped by subcommand name. ```yaml config-dump: subset: .datastore ingest-raws: config: keyword=value ``` -------------------------------- ### Example SHA256 Hashes for Package Pinning Source: https://github.com/lsst/daf_butler/blob/main/requirements/docker.txt These SHA256 hashes are used to verify the integrity and exact version of installed packages, ensuring reproducible builds in Docker. ```text --hash=sha256:6ed74185b2db44f41ef35fd1617c5888e59792da9bbc9190d6c7300617182616 ``` ```text --hash=sha256:708838739abf24b2ceb208d0e22403dd018faeef86ddac04319a62ae884c4f15 ``` ```text --hash=sha256:715479b9a2802ecac752a3b0efa2b0b60285cf962ee38414211abdfccc233b41 ``` ```text --hash=sha256:733784b6d6def852c814bce5f318d25da2ee65dd4839a0718641c696e09a2960 ``` ```text --hash=sha256:750e02e074872a3fad7f233b47734166440af3cdea0add3e95163110816d6752 ``` ```text --hash=sha256:752a45dc4a6934060b3b0dab47e04edc3326575f82be64bc4fc293914566503e ``` ```text --hash=sha256:7579e913a5339fb8fa133f6bbcfd8e6749696206cf05acdbdca71a1b436d8e72 ``` ```text --hash=sha256:7641bb8895e77f921102f72833904dcd9901df5d6d72a2ab8f31d04b7e51e4e7 ``` ```text --hash=sha256:7804338df6fcc08105c7745f1502ba68d900f45fd770d5bdd5288ddccb8a42d8 ``` ```text --hash=sha256:80d04837f55fc81da168b98de4f4b797ef007fc8a79ab71c6ec9bc4dd662b15b ``` ```text --hash=sha256:813c0e0132266c08eb87469a642cb30aaff57c5f426255419572aaeceeaa7bf4 ``` ```text --hash=sha256:82b271f5137d07749f7bf32f70b17ab6eaabedd297e75dce75081a24f76eb545 ``` ```text --hash=sha256:84c018e49c3bf790f9c2771c45e9313a08c2c2a6342b162cd650258b57817706 ``` ```text --hash=sha256:8751d2787c9131302398b11e6c8068053dcb55d5a8964e114b6e196cf16cb366 ``` ```text --hash=sha256:8778f0c7a52e56f75d12dae53ae320fae900a8b9b4164b981b9c5ce059cd1fcb ``` ```text --hash=sha256:87fad7d9ba98c86bcb41b2dc8dbb326619be2562af1f8ff50776a39e55721c5a ``` ```text --hash=sha256:8d828b6667a32a728a1ad1d93957cdf37489c57b97ae6c4de2860fa749b8fc1e ``` ```text --hash=sha256:8e385e4267ab76874ae30db04c627faaaf0b509e1ccc11a95b3fc3e83f855c00 ``` ```text --hash=sha256:92a0a01ead5e668468e952e4238cccd7c537364eb7d851ab144ab6627dbbe12f ``` ```text --hash=sha256:94e1885b270625a9a828c9793b4d52a64445299baa1fea5a173bf1d3dd9a1a5a ``` ```text --hash=sha256:a180c5e59792af262bf263b21a3c49353f25945d8d9f70628e73de370d55e1e1 ``` ```text --hash=sha256:a277ab8928b9f299723bc1a2dabb1265911b1a76341f90a510368ca44ad9ab66 ``` ```text --hash=sha256:a5fe03b42827c13cdccd08e6c0247b6a6d4b5e3cdc53fd1749f5896adcdc2356 ``` ```text --hash=sha256:a6c5863edfbe888d9eff9c8b8087354e27618d9da76425c119293f11712a6319 ``` ```text --hash=sha256:a89c23ef8d2c6b27fd200a42aa4ac72786e7c60d40efdc76e6011260b6e949c4 ``` ```text --hash=sha256:adb2597b428735679446b46c8badf467b4ca5f5056aae4d51a19f9570301b1ad ``` ```text --hash=sha256:ae196f021b5e7c78e918242d217db021ed2a6ace2bc6ae94c0fc596221c7f58d ``` ```text --hash=sha256:ae89db9e5f98a11a4bf50407d4363e7b09b31e55bc117b4f7d80aab97ba009e5 ``` ```text --hash=sha256:aed52fea0513bac0ccde438c188c8a471c4e0f457c2dd20cdbf6ea7a450046c7 ``` ```text --hash=sha256:aef65cd602a6d0e0ff6f9930fcb1c8fec60dd2cfcb6facaf4bdb0e5873042db0 ``` ```text --hash=sha256:af21eb4409a119e365397b2adbaca4c9ccab56543a65d5dbd9f920d6ac29f686 ``` ```text --hash=sha256:b14b2d9dac08e28bb8046a1a0434b1750eb221c8f5b87a68f4fa11a6f97b5e34 ``` ```text --hash=sha256:bb6d88045545b26da47aa879dd4a89a71d1dce0f0e549b1abcb31dfe4a8eac49 ``` ```text --hash=sha256:bb8cc7534f51d9a017b93e3e85b260924f909601c3df002bcdb58ddb4dc41a5c ``` ```text --hash=sha256:bc17a677b21b3502a21f66a8cc64f5bfad4df8a0b8434d661666f8ce90ac3af1 ``` ```text --hash=sha256:bd6c2a1c7573c64738d716488d2cdd3c00e340e4835707d8fdb8dc1a66ef164e ``` ```text --hash=sha256:bd9b23791fe793e4968dba0c447e12f78e425c59fc0e3b97f6450f4781f3ee60 ``` ```text --hash=sha256:c03a41a8784091e67a39648f70c5f97b5b6a37f216896d44d2cdcb82615339a0 ``` ```text --hash=sha256:c0f081d69a6e58272819b70288d3221a6ee64b98df852631c80f293514d3b274 ``` ```text --hash=sha256:c35abb8bfff0185efac5878da64c45dafd2b37fb0383add1be155a763c1f083d ``` ```text --hash=sha256:c36c333c39be2dbca264d7803333c896ab8fa7d4d6f0ab7edb7dfd7aea6e98c0 ``` ```text --hash=sha256:c45e9440fb78f8ddabcf714b68f936737a121355bf59f3907f4e17721b9d1aae ``` ```text --hash=sha256:c593052c465475e64bbfe5dbd81680f64a67fdc752c56d7a0ae2feefe0f ``` ```text --hash=sha256:cdd68a1fb318e290a2077696b7eb7a21a49163c455979c639bf5a5dcdc46617d ``` ```text --hash=sha256:ce3412fbe1e31eb81ea42f4169ed94861c56e643189e1e75f0041f3fe7020abe ``` ```text --hash=sha256:cf1493cd8607bec4d8a7b9b004e699fcf8f9103a9284cc94962cb73d20f9d4a3 ``` ```text --hash=sha256:cf29836da5119f3c8a8a70667b0ef5fdca3bb12f80fd06487cfa575b3909b393 ``` ```text --hash=sha256:d4a48e5b3c2a489fae013b7589308a40146ee081f6f509e047e0e096084ceca1 ``` ```text --hash=sha256:d560742f3c0d62afaccf9f41fe485ed69bd7661a241f86a3ef0f0fb8b1a397af ``` ```text --hash=sha256:d6038d37043bced98a66e68d3aa2b6a35505dc01328cd65217cefe82f25def44 ``` ```text --hash=sha256:d61f00a0869d77422d9b2aba989e2d24afa6ffd552af442e0e58de4f35ea6d00 ``` ```text --hash=sha256:d635aab80466bc95771bb78d5370e74d36d1fe31467b6b29b8b57b2a3cd7d22c ``` ```text --hash=sha256:dca4bbc466a95ba9c0234ef56d7dd9509f63da22274589ebd4ed7f1f4d4c54e3 ``` ```text --hash=sha256:dd915403e231e6b1809fe9b6d9fc55cf8fb5e02765ac625d9cd623342a7905d7 ``` ```text --hash=sha256:e044c39e41b92c845bc815e5ae4230804e8e7bc29e399b0437d64222d92809dd ``` ```text --hash=sha256:e060d01aec0a910bdccb8be71faf34e7799ce36950f8294c8bf612cba65a2c9e ``` ```text --hash=sha256:e1421b502d83040e6d7fb2fb18dff63957f720da3d77b2fbd3187ceb63755d7b ``` -------------------------------- ### Configure Butler CLI Entry Points Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst Example of how to declare Butler CLI entry points in a package's pyproject.toml file. ```toml [project.entry-points.'butler.cli'] obs_base = "lsst.obs.base.cli:get_cli_subcommands" ``` -------------------------------- ### Calling subcommand with argument Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst Example of invoking the 'checkout' subcommand with a specific branch name. ```text $ python git.py checkout mybranch checkout branch mybranch ``` -------------------------------- ### Butler Plugin Subcommand Manifest Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst Example of a YAML manifest file defining import paths and a list of available subcommands for a Butler plugin. ```yaml cmd: import: lsst.obs.base.cli.cmd commands: - register-instrument - write-curated-calibrations ``` -------------------------------- ### Define a Git-like Command with Options Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst This example shows how to add options to a Click command. It defines a 'commit' subcommand with '-m'/'--message' and '-a'/'--all' options. The 'all' option is a flag. ```py import click @click.group() def git(): """An example git-style interface.""" pass @git.command() @click.option("-m", "--message", help="commit message") @click.option("-a", "--all", help="commit all changed files", is_flag=True) def commit(all, message): """An example 'commit' subcommand.""" print(f"commit. all: {all}, message: {message}") if __name__ == "__main__": git() ``` -------------------------------- ### Custom Butler CLI Loader Implementation Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst Python example demonstrating how to create a custom Butler CLI by subclassing `LoaderCLI` and configuring local command packages and plugin environment variables. ```python import click from lsst.daf.butler.cli.butler import LoaderCLI # Change the class name to better describe your command. class ButlerCLI(LoaderCLI): # Replace this value with the import path to your `cmd` module. localCmdPkg = "lsst.daf.butler.cli.cmd" # Replace this value with the manifest environment variable described # above. pluginEnvVar = "DAF_BUTLER_PLUGINS" # Change ``cls=ButlerCLI`` to be the same as your new class name above. @click.command(cls=ButlerCLI, context_settings=dict(help_option_names=["-h", "--help"])) # You can remove log_level_option if you do not support it. You can add # other command options here. (Subcommand options are declared elsewhere). @log_level_option() def cli(log_level): # Normally you would handle the function arguments here, if there are # any, and/or pass them to other functions. `log_level` is unique; it # is handled by `LoaderCLI.get_command` and `LoaderCLI.list_commands`, # and is called in one of those functions before this function is # called. pass def main(): return cli() ``` -------------------------------- ### UUID Literal Examples Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/queries.rst Examples of using the UUID() function to create UUID literals in queries. ```SQL UUID('12345678-1234-5678-1234-567812345678') ``` ```SQL UUID('12345678123456781234567812345678') ``` -------------------------------- ### Implement CLI Subcommand Discovery Function Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst Example Python function to return registered click commands for a Butler CLI plugin. ```python import click from . import cmd def get_cli_subcommands() -> list[click.Command]: """Return the location of the CLI command plugin definitions. Returns ------- commands : `list` [ `click.Command` ] The command-line subcommands provided by this package. """ return [getattr(cmd, c) for c in cmd.__all__] ``` -------------------------------- ### Formatter Configuration with Write Parameters Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/formatters.rst Associates a storage class with a formatter and defines specific write parameters. The `format` parameter is an example of a custom option understood by the formatter. ```yaml Packages: formatter: lsst.obs.base.formatters.packages.PackagesFormatter parameters: format: yaml ``` -------------------------------- ### Define a Git-like Command Group and Subcommand Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst This example demonstrates how to define a command group ('git') and a subcommand ('pull') using Click decorators. The subcommand is added to the group using '@git.command()'. ```py # filename: git.py import click @click.group() def git(): """An example git-style interface.""" pass # Notice this uses "@git" instead of "@click", this adds the command to the # git group. @git.command() def pull(): """An example 'pull' subcommand.""" print("pull!") if __name__ == "__main__": git() ``` -------------------------------- ### Registering ObsCore RecordFactory Entry Point Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/dev/entryPoints.rst Example of how to register a custom ObsCore RecordFactory using the 'butler.obscore_factory' entry point group in pyproject.toml. The label should match the dimension universe namespace. ```toml [project.entry-points.'butler.obscore_factory'] daf_butler = "lsst.daf.butler.registry.obscore._records.DafButlerRecordFactory" ``` -------------------------------- ### Dependency with Multiple Hashes Source: https://github.com/lsst/daf_butler/blob/main/requirements/docker-test.txt This entry specifies a package and its version, followed by multiple SHA256 hashes. This ensures that the exact version of the package is installed, preventing supply chain attacks. ```text --hash=sha256:cc90c0b39b2e3c65ef52c804b72e3c58f8a04ab2a1871272798e5f9572c17d20 \ --hash=sha256:db63bf618e5dea46c07de12e900fe1cdd2541e6dc9dbae772a70b7d4d4765f6a \ --hash=sha256:ea8990436d914540a40ab24b6a77c0969695ed52f4a4874c5137ccf7045a7057 \ --hash=sha256:ecde28a596bead48b0cfd2a1b4416c3d43074c2d785e3a398d7ec1fc4d0f7fbb \ --hash=sha256:f5333311663ea94f75dd408665686aaf426563556bb5283554a3539177e03b8c \ --hash=sha256:fdfef35d751d510fcef5252703621574364fec16418c4a1e5e1055248401054b ``` -------------------------------- ### Equivalent Full DataFrame Load and Filter Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/concreteStorageClasses.rst Shows the equivalent operation to the partial read example, but by first loading the entire DataFrame and then using pandas.DataFrame.loc for filtering. This is typically less efficient than using the 'columns' parameter for partial reads. ```python full = butler.get("deepCoadd_obj", ...) full.loc[:, ["meas", ["HSC-R", "HSC-I"], ["base_SdssShape_xx", "base_SdssShape_yy"]]] ``` -------------------------------- ### Database.fromUri and Database.makeEngine Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/CHANGES.rst These methods now accept `sqlalchemy.engine.URL` instances in addition to connection strings. ```APIDOC ## Database.fromUri and Database.makeEngine ### Description Updates the `fromUri` and `makeEngine` methods of the `Database` class to accept `sqlalchemy.engine.URL` objects as input, alongside traditional connection strings. ### Method N/A (Method calls) ### Endpoint N/A ### Parameters - **uri** (str or `sqlalchemy.engine.URL`): The database connection URI or URL object. ### Request Example ```python from sqlalchemy.engine import URL # Using a URL object db_url = URL.create("sqlite", database="/path/to/database.db") database = Database.fromUri(db_url) # Using a string database_str = Database.fromUri("sqlite:////path/to/database.db") ``` ### Response #### Success Response - **`Database`**: An instance of the Database class configured with the provided URI. ### Response Example ```json ``` ``` -------------------------------- ### Define a Basic Butler Subcommand Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst A simple example of a subcommand intended to be loaded by the butler subcommand loader. It uses the '@click.command()' decorator. ```py @click.command() def my_subcommand(): """An example subcommand that can be loaded by the butler subcommand loader.""" pass ``` -------------------------------- ### Dump Butler Configuration Subset Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/formatters.rst Inspect the formatter section of a Butler configuration for a single file-based datastore. ```bash butler config-dump --subset .datastore.formatters ./repo-dir ``` -------------------------------- ### Packaging Dependency Specification Source: https://github.com/lsst/daf_butler/blob/main/requirements/docker-test.txt Specifies the 'packaging' package version and its SHA256 hashes for installation. Used for ensuring consistent package versions in the build. ```text packaging==26.2 \ --hash=sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e \ --hash=sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661 ``` -------------------------------- ### SQL IN Operator with Time Ranges Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/queries.rst Provides examples of using the IN operator for checking containment within time ranges, using literals, identifiers, and range identifiers. ```SQL -- using literals for both timestamp and time range T'2020-01-01' IN (T'2019-01-01', T'2020-01-01') (T'2020-01-01', T'2020-02-01') NOT IN (T'2019-01-01', T'2020-01-01') ``` ```SQL -- using identifiers for each timestamp in a time range T'2020-01-01' IN (interval.begin, interval.end) T'2020-01-01' NOT IN (interval_id) ``` ```SQL -- identifier on left side can represent either a timestamp or time range timestamp_id IN (interval.begin, interval.end) range_id NOT IN (interval_id) ``` -------------------------------- ### Define Inherited Storage Classes Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/formatters.rst Demonstrates defining specialized storage classes that inherit properties from a generic definition using the 'inheritsFrom' key. This promotes code reuse and organization. ```yaml GenericStorageClass: pytype: lsst.generic.GenericX components: image: ImageX metadata: Metadata GenericStorageClassI: inheritsFrom: GenericStorageClass pytype: lsst.generic.GenericI components: image: ImageI ``` -------------------------------- ### Pandas Dependency Specification Source: https://github.com/lsst/daf_butler/blob/main/requirements/docker-test.txt Specifies the 'pandas' package version and its numerous SHA256 hashes for installation. This ensures precise versioning for the pandas library in the Docker environment. ```text pandas==2.3.3 \ --hash=sha256:0242fe9a49aa8b4d78a4fa03acb397a58833ef6199e9aa40a95f027bb3a1b6e7 \ --hash=sha256:1611aedd912e1ff81ff41c745822980c49ce4a7907537be8692c8dbc31924593 \ --hash=sha256:1b07204a219b3b7350abaae088f451860223a52cfb8a6c53358e7948735158e5 \ --hash=sha256:1d37b5848ba49824e5c30bedb9c830ab9b7751fd049bc7914533e01c65f79791 \ --hash=sha256:23ebd657a4d38268c7dfbdf089fbc31ea709d82e4923c5ffd4fbd5747133ce73 \ --hash=sha256:2462b1a365b6109d275250baaae7b760fd25c726aaca0054649286bcfbb3e8ec \ --hash=sha256:28083c648d9a99a5dd035ec125d42439c6c1c525098c58af0fc38dd1a7a1b3d4 \ --hash=sha256:2e3ebdb170b5ef78f19bfb71b0dc5dc58775032361fa188e814959b74d726dd5 \ --hash=sha256:318d77e0e42a628c04dc56bcef4b40de67918f7041c2b061af1da41dcff670ac \ --hash=sha256:371a4ab48e950033bcf52b6527eccb564f52dc826c02afd9a1bc0ab731bba084 \ --hash=sha256:376c6446ae31770764215a6c937f72d917f214b43560603cd60da6408f183b6c \ --hash=sha256:3869faf4bd07b3b66a9f462417d0ca3a9df29a9f6abd5d0d0dbab15dac7abe87 \ --hash=sha256:3fd2f887589c7aa868e02632612ba39acb0b8948faf5cc58f0850e165bd46f35 \ --hash=sha256:4793891684806ae50d1288c9bae9330293ab4e083ccd1c5e383c34549c6e4250 \ --hash=sha256:4e0a175408804d566144e170d0476b15d78458795bb18f1304fb94160cabf40c \ --hash=sha256:503cf027cf9940d2ceaa1a93cfb5f8c8c7e6e90720a2850378f0b3f3b1e06826 \ --hash=sha256:5554c929ccc317d41a5e3d1234f3be588248e61f08a74dd17c9eabb535777dc9 \ --hash=sha256:56851a737e3470de7fa88e6131f41281ed440d29a9268dcbf0002da5ac366713 \ --hash=sha256:5caf26f64126b6c7aec964f74266f435afef1c1b13da3b0636c7518a1fa3e2b1 \ --hash=sha256:602b8615ebcc4a0c1751e71840428ddebeb142ec02c786e8ad6b1ce3c8dec523 \ --hash=sha256:6253c72c6a1d990a410bc7de641d34053364ef8bcd3126f7e7450125887dffe3 \ --hash=sha256:6435cb949cb34ec11cc9860246ccb2fdc9ecd742c12d3304989017d53f039a78 \ --hash=sha256:6d21f6d74eb1725c2efaa71a2bfc661a0689579b58e9c0ca58a739ff0b002b53 \ --hash=sha256:6d2cefc361461662ac48810cb14365a365ce864afe85ef1f447ff5a1e99ea81c \ --hash=sha256:74ecdf1d301e812db96a465a525952f4dde225fdb6d8e5a521d47e1f42041e21 \ --hash=sha256:75ea25f9529fdec2d2e93a42c523962261e567d250b0013b16210e1d40d7c2e5 \ --hash=sha256:854d00d556406bffe66a4c0802f334c9ad5a96b4f1f868adf036a21b11ef13ff \ --hash=sha256:8fe25fc7b623b0ef6b5009149627e34d2a4657e880948ec3c840e9402e5c1b45 \ --hash=sha256:900f47d8f20860de523a1ac881c4c36d65efcb2eb850e6948140fa781736e110 \ --hash=sha256:93c2d9ab0fc11822b5eece72ec9587e172f63cff87c00b062f6e37448ced4493 \ --hash=sha256:a16dcec078a01eeef8ee61bf64074b4e524a2a3f4b3be9326420cabe59c4778b \ --hash=sha256:a21d830e78df0a515db2b3d2f5570610f5e6bd2e27749770e8bb7b524b89b450 \ --hash=sha256:a45c765238e2ed7d7c608fc5bc4a6f88b642f2f01e70c0c23d2224dd21829d86 \ --hash=sha256:a637c5cdfa04b6d6e2ecedcb81fc52ffb0fd78ce2ebccc9ea964df9f658de8c8 \ --hash=sha256:a68e15f780eddf2b07d242e17a04aa187a7ee12b40b930bfdd78070556550e98 \ --hash=sha256:b3d11d2fda7eb164ef27ffc14b4fcab16a80e1ce67e9f57e19ec0afaf715ba89 \ --hash=sha256:b468d3dad6ff947df92dcb32ede5b7bd41a9b3cceef0a30ed925f6d01fb8fa66 \ --hash=sha256:b98560e98cb334799c0b07ca7967ac361a47326e9b4e5a7dfb5ab2b1c9d35a1b \ --hash=sha256:bdcd9d1167f4885211e401b3036c0c8d9e274eee67ea8d0758a256d60704cfe8 \ --hash=sha256:bf1f8a81d04ca90e32a0aceb819d34dbd378a98bf923b6398b9a3ec0bf44de29 \ --hash=sha256:c46467899aaa4da076d5abc11084634e2d197e9460643dd455ac3db5856b24d6 \ --hash=sha256:c4fc4c21971a1a9f4bdb4c73978c7f7256caa3e62b323f70d6cb80db583350bc \ --hash=sha256:c503ba5216814e295f40711470446bc3fd00f0faea8a086cbc688808e26f92a2 \ --hash=sha256:d051c0e065b94b7a3cea50eb1ec32e912cd96dba41647eb24104b6c6c14c5788 \ --hash=sha256:d3e28b3e83862ccf4d85ff19cf8c20b2ae7e503881711ff2d534dc8f761131aa \ --hash=sha256:db4301b2d1f926ae677a751eb2bd0e8c5f5319c9cb3f88b0becbbb0b07b34151 ``` -------------------------------- ### Define a Command with Underscore to Dash Conversion Source: https://github.com/lsst/daf_butler/blob/main/doc/lsst.daf.butler/writing-subcommands.rst Illustrates how Click automatically converts underscores in Python function names to dashes for command-line subcommands. For example, 'register_instrument' becomes 'register-instrument'. ```py @click.command() def register_instrument(): ... ```