Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Fixing-PBR-for-gl…
Browse files Browse the repository at this point in the history
…TF-loader
  • Loading branch information
m-agour committed May 30, 2024
2 parents fe06956 + da7d735 commit 8220043
Show file tree
Hide file tree
Showing 241 changed files with 7,591 additions and 5,318 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
skip = .git,*.pdf,*.svg,*.bib,*.html
# ue,lod,ans,lastr,numer,lamda,PrIs -- variable names
# Hart,Flagg -- name
ignore-words-list = IST,nd,te,ue,lod,hart,ans,lastr,numer,lamda,flagg,pris,lod,IST
ignore-words-list = IST,nd,te,ue,lod,hart,ans,lastr,numer,lamda,flagg,pris,lod,IST,tese
14 changes: 0 additions & 14 deletions .flake8

This file was deleted.

14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
groups:
actions:
patterns:
- "*"
29 changes: 29 additions & 0 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: code format

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
pre-commit:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
requires: ['latest']

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install and run pre-commit hooks
uses: pre-commit/[email protected]
4 changes: 2 additions & 2 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v1
uses: codespell-project/actions-codespell@v2
6 changes: 3 additions & 3 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
Expand Down Expand Up @@ -62,5 +62,5 @@ jobs:
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
repository-name: fury-gl/fury-website
folder: ./docs/build/html-web-only
target-folder: v0.9.x
target-folder: v0.10.x
clean: false
15 changes: 8 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ defaults:
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: bash
Expand Down Expand Up @@ -54,10 +55,10 @@ jobs:
PRE_WHEELS: "https://pypi.anaconda.org/scipy-wheels-nightly/simple"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v2
- uses: actions/cache@v4
if: startsWith(runner.os, 'Linux')
with:
path: |
Expand All @@ -66,22 +67,22 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
- uses: actions/cache@v4
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
- uses: actions/cache@v4
if: startsWith(runner.os, 'Windows')
with:
path: ~/.pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Virtualenv
Expand All @@ -90,7 +91,7 @@ jobs:
python -m pip install --upgrade pip virtualenv
virtualenv $VENV_ARGS venv
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
if: ${{ matrix.install-type == 'conda' }}
with:
auto-update-conda: true
Expand All @@ -113,7 +114,7 @@ jobs:
ci/run_tests.sh
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
if: ${{ matrix.coverage }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ Sreekar Chigurupati <[email protected]> sreekar chigurupati <chigurup
Johny Daras <[email protected]> lej0hn <[email protected]>
Francois Rheault <[email protected]> frheault <[email protected]>
Dwij Raj Hari <[email protected]> Dwij Raj Hari <[email protected]>
Tania Castillo <[email protected]> tvcastillod <[email protected]>
Tania Castillo <[email protected]> Tania Castillo <[email protected]>
22 changes: 9 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,8 @@ repos:
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
# - repo: https://github.com/grantjenks/blue
# rev: v0.9.1
# hooks:
# - id: blue
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: "^(docs/experimental|tools)/"
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
Expand All @@ -49,3 +37,11 @@ repos:
- importlib_resources
args: ["fury"]
pass_filenames: false
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
hooks:
# Run the linter
- id: ruff
args: [ --fix]
# Run the formatter
- id: ruff-format
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, FURY - Free Unified Rendering in Python. All rights reserved.
Copyright (c) 2024, FURY - Free Unified Rendering in Python. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/_valid_examples.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ readme = "file: _animation.rst"
position = 10
enable = true
files = [
"viz_interpolators.py",
# "viz_interpolators.py",
"viz_bezier_interpolator.py",
"viz_introduction.py",
"viz_camera.py",
Expand Down
6 changes: 2 additions & 4 deletions docs/examples/collision-particles.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@


def box_edges(box_lx, box_ly, box_lz):

edge1 = 0.5 * np.array(
[
[box_lx, box_ly, box_lz],
Expand Down Expand Up @@ -54,7 +53,6 @@ def collision():
sec = int(num_vertices / num_particles)

for i, j in np.ndindex(num_particles, num_particles):

if i == j:
continue
distance = np.linalg.norm(xyz[i] - xyz[j])
Expand Down Expand Up @@ -148,7 +146,7 @@ def collision():
counter = itertools.count()

vertices = utils.vertices_from_actor(sphere_actor)
vcolors = utils.colors_from_actor(sphere_actor, 'colors')
vcolors = utils.colors_from_actor(sphere_actor, "colors")
no_vertices_per_sphere = len(vertices) / num_particles
initial_vertices = vertices.copy() - np.repeat(xyz, no_vertices_per_sphere, axis=0)

Expand Down Expand Up @@ -177,4 +175,4 @@ def timer_callback(_obj, _event):
if interactive:
showm.start()

window.record(showm.scene, size=(900, 768), out_path='simple_collisions.png')
window.record(showm.scene, size=(900, 768), out_path="simple_collisions.png")
38 changes: 18 additions & 20 deletions docs/examples/viz_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
the main functions using the following modules.
"""

import numpy as np
from dipy.data.fetcher import fetch_bundles_2_subjects, read_bundles_2_subjects

###############################################################################
Expand All @@ -36,6 +35,7 @@
#
# First we need to fetch and load some datasets.
from dipy.tracking.streamline import Streamlines
import numpy as np

from fury import actor, ui, window

Expand All @@ -46,19 +46,19 @@
# ``af left`` (left arcuate fasciculus) and maps, e.g. FA for a specific
# subject.

res = read_bundles_2_subjects('subj_1', ['t1', 'fa'], ['af.left', 'cst.right', 'cc_1'])
res = read_bundles_2_subjects("subj_1", ["t1", "fa"], ["af.left", "cst.right", "cc_1"])

###############################################################################
# We will use 3 bundles, FA and the affine transformation that brings the voxel
# coordinates to world coordinates (RAS 1mm).

streamlines = Streamlines(res['af.left'])
streamlines.extend(res['cst.right'])
streamlines.extend(res['cc_1'])
streamlines = Streamlines(res["af.left"])
streamlines.extend(res["cst.right"])
streamlines.extend(res["cc_1"])

data = res['fa']
data = res["fa"]
shape = data.shape
affine = res['affine']
affine = res["affine"]

###############################################################################
# With our current design it is easy to decide in which space you want the
Expand Down Expand Up @@ -134,23 +134,23 @@
min_value=0,
max_value=shape[2] - 1,
initial_value=shape[2] / 2,
text_template='{value:.0f}',
text_template="{value:.0f}",
length=140,
)

line_slider_x = ui.LineSlider2D(
min_value=0,
max_value=shape[0] - 1,
initial_value=shape[0] / 2,
text_template='{value:.0f}',
text_template="{value:.0f}",
length=140,
)

line_slider_y = ui.LineSlider2D(
min_value=0,
max_value=shape[1] - 1,
initial_value=shape[1] / 2,
text_template='{value:.0f}',
text_template="{value:.0f}",
length=140,
)

Expand Down Expand Up @@ -197,8 +197,8 @@ def build_label(text):
label = ui.TextBlock2D()
label.message = text
label.font_size = 18
label.font_family = 'Arial'
label.justification = 'left'
label.font_family = "Arial"
label.justification = "left"
label.bold = False
label.italic = False
label.shadow = False
Expand All @@ -208,15 +208,15 @@ def build_label(text):
return label


line_slider_label_z = build_label(text='Z Slice')
line_slider_label_x = build_label(text='X Slice')
line_slider_label_y = build_label(text='Y Slice')
opacity_slider_label = build_label(text='Opacity')
line_slider_label_z = build_label(text="Z Slice")
line_slider_label_x = build_label(text="X Slice")
line_slider_label_y = build_label(text="Y Slice")
opacity_slider_label = build_label(text="Opacity")

###############################################################################
# Now we will create a ``panel`` to contain the sliders and labels.

panel = ui.Panel2D(size=(300, 200), color=(1, 1, 1), opacity=0.1, align='right')
panel = ui.Panel2D(size=(300, 200), color=(1, 1, 1), opacity=0.1, align="right")
panel.center = (1030, 120)

panel.add_element(line_slider_label_x, (0.1, 0.75))
Expand Down Expand Up @@ -262,15 +262,13 @@ def win_callback(obj, _event):
scene.reset_clipping_range()

if interactive:

show_m.add_window_callback(win_callback)
show_m.render()
show_m.start()

else:

window.record(
scene, out_path='bundles_and_3_slices.png', size=(1200, 900), reset_camera=False
scene, out_path="bundles_and_3_slices.png", size=(1200, 900), reset_camera=False
)

del show_m
Loading

0 comments on commit 8220043

Please sign in to comment.