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

Support ptex mesh - step 3: better naming #196

Merged
merged 6 commits into from
Sep 10, 2019
Merged

Support ptex mesh - step 3: better naming #196

merged 6 commits into from
Sep 10, 2019

Conversation

bigbike
Copy link
Contributor

@bigbike bigbike commented Sep 6, 2019

This PR is to rename a number of buffers, textures to avoid ambiguity and increase the readability of the code.

-) rename the buffers on GPU side in PTexMeshData;
-) rename variables in PTexMeshDrawable;

Motivation and Context

It caused a lot of confusion in the past, making it difficult to read, maintain and debug.

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

-) rename the buffers on GPU side in PTexMeshData;
-) rename variables in PTexMeshDrawable;
@bigbike bigbike requested review from mosra and msavva September 6, 2019 23:15
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Sep 6, 2019
@bigbike bigbike assigned erikwijmans and unassigned erikwijmans Sep 6, 2019
@bigbike
Copy link
Contributor Author

bigbike commented Sep 6, 2019

This PR is ready to be reviewed. Thanks.

@bigbike
Copy link
Contributor Author

bigbike commented Sep 7, 2019

By the way, please take a look at the CI failure. It says ModuleNotFoundError: No module named 'Cython', which I do not think caused by this PR.

Copy link
Collaborator

@msavva msavva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the minimal PR @bigbike . Overall looks good, except for the removal of the namespace Cr = Corrade; alias. We use this in other parts of the code, so I would leave it here as well.

@@ -25,8 +25,6 @@
static constexpr int ROTATION_SHIFT = 30;
static constexpr int FACE_MASK = 0x3FFFFFFF;

namespace Cr = Corrade;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rationale for getting rid of the shorter namespace alias? We are using this pervasively in other parts of the code (e.g., ResourceManager) and I don't think readability is impacted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand it may save you a couple of characters when coding. But I actually think it does decrease the readability. When I started this project and read this file, I actually searched what the "Cr" was.

Yes, it is used in a couple of files. But I see more places are using Corrade:: directly. And I prefer this way since it is straightforward.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grep -rl 'Cr = Corrade' src/esp | wc shows 7 cpp files for me. In my opinion, namespace aliasing in cpp files is quite reasonable, anyone interested in looking at implementation detail will quickly see the alias at the top of the file and understand. @mosra @erikwijmans @msbaines do you have opinions about this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I would say this change (removing a namespace alias) is orthogonal to the "member name improvements" in this PR. If we make a decision one way or the other, I would still advocate namespace alias changes be done in a separate PR regardless.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No preference from me. Cor<tab> vs Cr<tab> are about the same length. I can both see an argument for increasing readability by using Corrade and increasing readability by reducing the length of names (Cr::Utility::Directory::MapDeleter seems better than Corrade::Utility::Directory::MapDeleter, for instance).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @mosra's suggestion is very reasonable to me.

What is most important in cases like this is to have:

  1. Consistent and agreed upon conventions of referring to modules. This should be documented somewhere so the convention is clear and that the issue is not revisited.
  2. No arbitrary changing of convention without discussion so that code can remain consistent
  3. Small to the point PRs that are as close to "one change" as possible so that PRs do not feel like an overhead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be documented somewhere

👍 Someone should be taking notes on what to populate a Coding Style document with :)

I would advocate against making namespace alias changes as part of this PR.

Definitely. Even if you (or anybody else as a PR author) don't like the conventions used, changing them only adds extra lines to the diff, extra overhead for each reviewer.

If done separately in a dedicated PR instead, this change could be simply a global replace of Magnum:: with Mn::, magnum. with mn. and then adding namespace Mn = Magnum or import magnum as mn (and removing using namespace Magnum; if it's still somewhere) until everything compiles again and tests pass. Then, if it's really just that, with no other changes requiring special attention, such a PR would be extremely easy to review.

Copy link
Contributor

@angelxuanchang angelxuanchang Sep 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have an existing coding style document? I can help track what we need to put into the coding style document.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed we do, will share with all in the dev slack channel -- thanks @angelxuanchang !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the namespace alias. Currently, it's a bit confusing in that it is not followed everywhere. Once we resolve that, I think it will become second nature.

@bigbike
Copy link
Contributor Author

bigbike commented Sep 10, 2019

Let me know if you have more comments about this PR before I merge it. Thanks.

Copy link
Collaborator

@msavva msavva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@bigbike
Copy link
Contributor Author

bigbike commented Sep 10, 2019

Sincerely thank all the reviewers' work. Merge it.

@bigbike bigbike merged commit 2a1bb29 into master Sep 10, 2019
@bigbike bigbike deleted the replica_rename branch September 10, 2019 20:23
eundersander pushed a commit to eundersander/habitat-sim that referenced this pull request Aug 6, 2020
…igation tasks. (facebookresearch#196)

Redesign Habitat-API to support continues actions and not pure navigation tasks.

New class for Task Actions:
Added registry for actions classes. We use a class not a method for action definition to provide relevant action space that uses Task/Dataset instance's information like number of words for answer vocabulary, resolution of frame etc.
Change step function interface to support action parameters
Added step function to the task with actions defined as task's methods
Provide action space for each type of action
Add reset function to Actions
Added teleport action as example of parameterized action.
Provide functionality to register several actions of same type using config only
Create ActionSpace GYM space to describe action space in elegant way for multiple actions. Propagate action space through env.
Moved Simulator calls to EmbodiedTask:

Move is_episode_over functionality to Task class from Simulator, handle capturing finished conditions for different tasks differently
Remove simulator STOP action
Make Task methods reset and step provide observations that include sim observations
Add possible actions to config and task
Move from SimulatorAction list to defined Tasks in actions, handle non-stop actions
Check usage of *args, **kwargs for all sensors, action, measures.
Use dict as return type for act methods.
Made VecEnv independent from Env step signature.
Ram81 pushed a commit to Ram81/habitat-web-sim that referenced this pull request Dec 10, 2020
* Support ptex mesh - step 3: better naming

-) rename the buffers on GPU side in PTexMeshData;
-) rename variables in PTexMeshDrawable;

* minor

* minor

* minor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants