forked from mitsuba-renderer/mitsuba2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrapped up distr_2d.h refactoring and fixed testcases
- Loading branch information
Showing
14 changed files
with
605 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule nanogui
updated
7 files
+1 −1 | CMakeLists.txt | |
+1 −0 | include/nanogui/common.h | |
+2 −0 | include/nanogui/vector.h | |
+1 −0 | src/example1.cpp | |
+5 −5 | src/shader_gl.cpp | |
+3 −0 | src/texture.cpp | |
+1 −0 | src/texture_gl.cpp |
Submodule zeromq
deleted from
d7c3a6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
[tool:pytest] | ||
minversion = 3.0 | ||
norecursedirs = ext ext_build build build-debug CMakeFiles dist include | ||
norecursedirs = ext ext_build build build-debug CMakeFiles dist include .git | ||
python_paths = dist dist/python | ||
|
||
|
||
[pycodestyle] | ||
# E402 module level import not at top of file | ||
# E402 module level import not at top of file (needed for Mitsuba variants) | ||
ignore = E402 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
set(MTS_PLUGIN_PREFIX "bsdfs") | ||
|
||
add_plugin(blendbsdf blendbsdf.cpp) | ||
add_plugin(conductor conductor.cpp) | ||
add_plugin(dielectric dielectric.cpp) | ||
add_plugin(diffuse diffuse.cpp) | ||
add_plugin(mask mask.cpp) | ||
add_plugin(measured measured.cpp) | ||
add_plugin(null null.cpp) | ||
add_plugin(plastic plastic.cpp) | ||
add_plugin(roughconductor roughconductor.cpp) | ||
add_plugin(blendbsdf blendbsdf.cpp) | ||
add_plugin(conductor conductor.cpp) | ||
add_plugin(dielectric dielectric.cpp) | ||
add_plugin(diffuse diffuse.cpp) | ||
add_plugin(mask mask.cpp) | ||
add_plugin(measured measured.cpp) | ||
add_plugin(null null.cpp) | ||
add_plugin(plastic plastic.cpp) | ||
add_plugin(roughconductor roughconductor.cpp) | ||
add_plugin(roughdielectric roughdielectric.cpp) | ||
add_plugin(roughplastic roughplastic.cpp) | ||
add_plugin(thindielectric thindielectric.cpp) | ||
add_plugin(twosided twosided.cpp) | ||
add_plugin(polarizer polarizer.cpp) | ||
add_plugin(retarder retarder.cpp) | ||
add_plugin(roughplastic roughplastic.cpp) | ||
add_plugin(thindielectric thindielectric.cpp) | ||
add_plugin(twosided twosided.cpp) | ||
add_plugin(polarizer polarizer.cpp) | ||
add_plugin(retarder retarder.cpp) | ||
|
||
# Register the test directory | ||
add_tests(${CMAKE_CURRENT_SOURCE_DIR}/tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# This file rewrites exceptions caught by PyTest and makes traces involving | ||
# pybind11 classes more readable. It e.g. replaces "<built-in method allclose | ||
# of PyCapsule object at 0x7ffa78041090>" by "allclose" which is arguably just | ||
# as informative and much more compact. | ||
|
||
import pytest | ||
import re | ||
|
||
re1 = re.compile(r'<built-in method (\w*) of PyCapsule object at 0x[0-9a-f]*>') | ||
re2 = re.compile(r'<bound method PyCapsule.(\w*)[^>]*>') | ||
|
||
|
||
def patch_line(s): | ||
s = re1.sub(r'\1', s) | ||
s = re2.sub(r'\1', s) | ||
return s | ||
|
||
|
||
def patch_tb(tb): # tb: ReprTraceback | ||
for entry in tb.reprentries: | ||
entry.lines = [patch_line(l) for l in entry.lines] | ||
|
||
|
||
@pytest.hookimpl(hookwrapper=True) | ||
def pytest_runtest_makereport(item, call): | ||
outcome = yield | ||
rep = outcome.get_result() | ||
if rep.outcome == 'failed': | ||
for entry in rep.longrepr.chain: | ||
patch_tb(entry[0]) | ||
return rep | ||
|
||
|
||
def generate_fixture(variant): | ||
@pytest.fixture(scope='module') | ||
def fixture(): | ||
try: | ||
import mitsuba | ||
mitsuba.set_variant(variant) | ||
except Exception: | ||
pytest.skip('Mitsuba variant "%s" is not enabled!' % variant) | ||
globals()['variant_' + variant] = fixture | ||
|
||
|
||
for variant in ['scalar_rgb', 'scalar_spectral', | ||
'scalar_mono_polarized', 'packet_rgb']: | ||
generate_fixture(variant) | ||
del generate_fixture | ||
|
||
|
||
@pytest.fixture(params=['packet_rgb', 'gpu_rgb']) | ||
def variants_vec_rgb(request): | ||
try: | ||
import mitsuba | ||
mitsuba.set_variant(request.param) | ||
except Exception: | ||
pytest.skip('Mitsuba variant "%s" is not enabled!' % request.param) | ||
return request.param | ||
|
||
|
||
@pytest.fixture(params=['scalar_rgb', 'packet_rgb']) | ||
def variants_cpu_rgb(request): | ||
try: | ||
import mitsuba | ||
mitsuba.set_variant(request.param) | ||
except Exception: | ||
pytest.skip('Mitsuba variant "%s" is not enabled!' % request.param) | ||
return request.param | ||
|
||
|
||
@pytest.fixture(params=['scalar_rgb', 'packet_rgb', 'gpu_rgb']) | ||
def variants_all_rgb(request): | ||
try: | ||
import mitsuba | ||
mitsuba.set_variant(request.param) | ||
except Exception: | ||
pytest.skip('Mitsuba variant "%s" is not enabled!' % request.param) | ||
return request.param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.