google-deepmind / dm_control

Google DeepMind's software stack for physics-based simulation and Reinforcement Learning environments, using MuJoCo.
Apache License 2.0
3.82k stars 669 forks source link

Append or not append a hash string to the name of a file when ```to_xml_string()``` is called #496

Closed barikata1984 closed 4 weeks ago

barikata1984 commented 1 month ago

To deal with issue #483 without editing the source code locally, allow users to select to add a hash string after the name of a file when it is registered to VFS by specifying an optional boolean argument filename_with_hash. Sample usage can be found here.

google-cla[bot] commented 1 month ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

yuvaltassa commented 1 month ago

Thanks for this!

  1. Can you please do the CLA thing?
  2. Do I understand correctly that you're changing the default behavior?
barikata1984 commented 1 month ago

@yuvaltassa

  1. CLA completed.
  2. No, the default behaviour won't change. The default value of filename_with_hash is set at True. This also applies to intermediate methods, e.g. to_xml(), _attributes_to_xml(), and so on, up to get_vfs_filename(). As a result, if a user does not provide filename_with_hash or does explicitly set filename_with_hash=True, a hash string is appended to each file name. Below is just a quick demonstration that calling to_xml_string() without setting filename_with_hash=False registers a file with a hash string appended to the file name: Screenshot from 2024-09-26 15-02-13
yuvaltassa commented 1 month ago

Hopefully @saran-t will get to this soon.

saran-t commented 4 weeks ago

Merged in b2644081ae31c2adbe5a8319f0b9695e3ef9f8e1