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

Sourcery refactored main branch #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jun 20, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from dsx1986 June 20, 2023 22:42
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

for i in trange(retries):

for _ in trange(retries):
Copy link
Author

Choose a reason for hiding this comment

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

Function find_flat_location refactored with the following changes:

Comment on lines -106 to +105

Copy link
Author

Choose a reason for hiding this comment

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

Function compose_scene refactored with the following changes:

Comment on lines -75 to +79
if len(overrides) > 0:
if overrides:
print("Overriden parameters:", overrides)
output = list(overrides)
for i, o in enumerate(overrides):
if ('=' in o) and not any((c in o) for c in "\"'[]"):
if '=' in o and all(c not in o for c in "\"'[]"):
Copy link
Author

Choose a reason for hiding this comment

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

Function sanitize_gin_override refactored with the following changes:

Comment on lines -328 to +329
f'Running tasks on an already generated scene, you need to specify --seed or results will'
f' not be view-consistent')
'Running tasks on an already generated scene, you need to specify --seed or results will not be view-consistent'
)
Copy link
Author

Choose a reason for hiding this comment

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

Function determine_scene_seed refactored with the following changes:

@@ -95,6 +95,7 @@ def choose_forest_params():
'select_scale': uniform(0.03, 0.3)
}
return [tree_params() for _ in range(n_tree_species)]

Copy link
Author

Choose a reason for hiding this comment

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

Function compose_scene refactored with the following changes:

geom = []
for e in bm.edges:
if e.calc_length() > .04:
geom.append(e)
geom = [e for e in bm.edges if e.calc_length() > .04]
Copy link
Author

Choose a reason for hiding this comment

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

Function ElkhornBaseCoralFactory.cluster_displace refactored with the following changes:

count = 1
for e in v.link_edges:
count += counts[e.other_vert(v).index]
count = 1 + sum(counts[e.other_vert(v).index] for e in v.link_edges)
Copy link
Author

Choose a reason for hiding this comment

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

Function FanBaseCoralFactory.add_radius refactored with the following changes:

if uniform(0, 1) < .25:
base_hue = uniform(0, 1)
else:
base_hue = uniform(-.2, .3) % 1
return base_hue
return uniform(0, 1) if uniform(0, 1) < .25 else uniform(-.2, .3) % 1
Copy link
Author

Choose a reason for hiding this comment

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

Function CoralFactory.build_base_hue refactored with the following changes:

Comment on lines -75 to +97
major_config = {
return {
'n': n_branch,
'path_kargs': lambda idx: {'n_pts': n_major + 1, 'std': .4, 'momentum': .4, 'sz': uniform(.08, .1)},
'path_kargs': lambda idx: {
'n_pts': n_major + 1,
'std': 0.4,
'momentum': 0.4,
'sz': uniform(0.08, 0.1),
},
'spawn_kargs': lambda idx: {
'init_vec': [span * np.cos(2 * np.pi * idx / n_branch + uniform(-np.pi / 9, np.pi / 9)),
span * np.sin(2 * np.pi * idx / n_branch + uniform(-np.pi / 9, np.pi / 9)),
math.sqrt(1 - span * span)]},
'children': [minor_config]}
return major_config
'init_vec': [
span
* np.cos(
2 * np.pi * idx / n_branch + uniform(-np.pi / 9, np.pi / 9)
),
span
* np.sin(
2 * np.pi * idx / n_branch + uniform(-np.pi / 9, np.pi / 9)
),
math.sqrt(1 - span * span),
]
},
'children': [minor_config],
}
Copy link
Author

Choose a reason for hiding this comment

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

Function TreeBaseCoralFactory.bush_config refactored with the following changes:

Comment on lines -118 to +154
major_config = {
return {
'n': n_branch,
'path_kargs': lambda idx: {
'n_pts': n_major * 2 + 1,
'std': .4,
'momentum': .4,
'sz': uniform(.08, .1)},
'std': 0.4,
'momentum': 0.4,
'sz': uniform(0.08, 0.1),
},
'spawn_kargs': lambda idx: {
'init_vec': [span * np.cos(2 * np.pi * idx / n_branch + uniform(-np.pi / 9, np.pi / 9)),
span * np.sin(2 * np.pi * idx / n_branch + uniform(-np.pi / 9, np.pi / 9)),
math.sqrt(1 - span * span)]},
'children': [minor_config]}
return major_config
'init_vec': [
span
* np.cos(
2 * np.pi * idx / n_branch + uniform(-np.pi / 9, np.pi / 9)
),
span
* np.sin(
2 * np.pi * idx / n_branch + uniform(-np.pi / 9, np.pi / 9)
),
math.sqrt(1 - span * span),
]
},
'children': [minor_config],
}
Copy link
Author

Choose a reason for hiding this comment

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

Function TreeBaseCoralFactory.twig_config refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants