Skip to content

Commit

Permalink
Merge pull request #34 from ederag/update_ch
Browse files Browse the repository at this point in the history
Fix precompilation (LazySets.VectorIterator removal and JSServe => Bonito)
  • Loading branch information
brianguenter authored Aug 8, 2024
2 parents 0ff6d0e + 0c998f8 commit 6e6c44e
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ['1.8']
version: ['1.8', '1.10']
os: [ubuntu-latest, windows-latest]
arch: [x64]
include:
Expand Down
20 changes: 11 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ repository = "https://github.com/microsoft/OpticSim.jl"
version = "0.6.0"

[deps]
Bonito = "824d6782-a2ef-11e9-3a09-e5662e0c26f8"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Expand All @@ -23,7 +24,6 @@ ImageView = "86fae568-95e7-573e-a6b2-d8a6b900c9ef"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JSServe = "824d6782-a2ef-11e9-3a09-e5662e0c26f9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LazySets = "b4f0291d-fe17-52bc-9479-3d1a343d9043"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand Down Expand Up @@ -61,38 +61,40 @@ ColorTypes = "0.10, 0.11"
Colors = "0.12"
Conda = "1.5"
DataFrames = "0.22, 1.0"
DelimitedFiles = "1"
Distributions = "0.24, 0.25"
FileIO = "1.4"
Format = "1.3"
ForwardDiff = "0.10"
GLMakie = "0.4, 0.5, 0.6, 0.7, 0.8"
GLMakie = "0.4, 0.5, 0.6, 0.7, 0.8, 0.9"
GeometryBasics = "0.3, 0.4"
HTTP = "0.8, 0.9, 1"
ImageView = "0.10, 0.11"
Images = "0.23, 0.24, 0.25"
ImageView = "0.10, 0.11, 0.12"
Images = "0.23, 0.24, 0.25, 0.26"
Ipopt = "0.6, 0.7, 0.8, 0.9, 1"
JSServe = "1, 2"
JuMP = "0.21, 0.22, 1"
LazySets = "1, 2"
Luxor = "2.10, 3"
Makie = "0.15, 0.16, 0.17, 0.18, 0.19"
Makie = "0.15, 0.16, 0.17, 0.18, 0.19, 0.20"
MeshIO = "0.4"
NLopt = "0.6"
NLopt = "0.6, 1"
Optim = "1.2"
PackageCompiler = "1.2, 2"
Plots = "1.10"
Pluto = "0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19"
PlutoUI = "0.7"
Polynomials = "2.0, 3"
Polynomials = "2.0, 3, 4"
PyCall = "1.92"
ReverseDiff = "1.7"
Revise = "3"
Roots = "1, 2"
SHA = "0.7"
SpecialFunctions = "2"
StaticArrays = "1.0"
Statistics = "1"
StringEncodings = "0.3"
Unitful = "1.6"
WGLMakie = "0.4, 0.6, 0.7, 0.8"
WGLMakie = "0.4, 0.6, 0.7, 0.8, 0.9"
ZipFile = "0.9, 0.10"
Zygote = "0.6"
julia = "1.5.2"
4 changes: 2 additions & 2 deletions docs/src/glasscat.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ The central configuration file for GlassCat is located at `src/GlassCat/data/sou
following default entries.

```
NIKON a49714470fa875ad4fd8d11cbc0edbf1adfe877f42926d7612c1649dd9441e75 https://www.nikon.com/products/components/assets/pdf/nikon_zemax_data.zip
OHARA 0c9021bf11b8d4e660012191818685ad3110d4f9490699cabdc89aae1fd26d2e https://www.oharacorp.com/xls/OHARA_201130_CATALOG.zip
NIKON a49714470fa875ad4fd8d11cbc0edbf1adfe877f42926d7612c1649dd9441e75 https://www.nikon.com/business/components/assets/pdf/nikon_zemax_data.zip
OHARA b8a0bea2a59ec643998040255925c7e051ea5352ff239f1aca50268ac27bb7f7 https://oharacorp.com/wp-content/uploads/2024/02/OHARA_240131_CATALOG.zip
HOYA b02c203e5a5b7a8918cc786badf0a9db1fe2572372c1c163dc306b0a8a908854 http://www.hoya-opticalworld.com/common/agf/HOYA20210105.agf
SCHOTT e9aabbb8ebff116ba0c106a71afd86e72f2a397ac9bc447469129e325e795f4e https://www.schott.com/d/advanced_optics/6959f9a4-0e4f-4ef2-a302-2347468a82f5/1.31/schott-optical-glass-overview-zemax-format.zip
SUMITA c1093e42a1d08acbe30698aba730161e3b43f8f0d50533f65de8b6b11100fdc8 https://www.sumita-opt.co.jp/en/wp/wp-content/themes/sumita-opt-en/download-files.php files%5B%5D=new_sumita.agf&category=data
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ The system will automatically download glass catalog (.agf) files from some manu

Here are links to several publicly available glass files:

* [NIKON](https://www.nikon.com/products/components/assets/pdf/nikon_zemax_data.zip) (automatically downloaded)
* [NIKON](https://www.nikon.com/business/components/assets/pdf/nikon_zemax_data.zip) (automatically downloaded)
* [NHG](http://hbnhg.com/down/data/nhgagp.zip) (you have to manually download)
* [OHARA](https://www.oharacorp.com/xls/OHARA_201130_CATALOG.zip) (automatically downloaded)
* [OHARA](https://oharacorp.com/wp-content/uploads/2024/02/OHARA_240131_CATALOG.zip) (automatically downloaded)
* [HOYA](https://hoyaoptics.com/wp-content/uploads/2019/10/HOYA20170401.zip) (automatically downloaded)
* [SUMITA](https://www.sumita-opt.co.jp/en/download/) (automatically downloaded)
* [SCHOTT](https://www.schott.com/advanced_optics/english/download/index.html) (automatically downloaded)
Expand Down
4 changes: 2 additions & 2 deletions src/GlassCat/data/sources.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NIKON a49714470fa875ad4fd8d11cbc0edbf1adfe877f42926d7612c1649dd9441e75 https://www.nikon.com/products/components/assets/pdf/nikon_zemax_data.zip
OHARA 0c9021bf11b8d4e660012191818685ad3110d4f9490699cabdc89aae1fd26d2e https://www.oharacorp.com/xls/OHARA_201130_CATALOG.zip
NIKON a49714470fa875ad4fd8d11cbc0edbf1adfe877f42926d7612c1649dd9441e75 https://www.nikon.com/business/components/assets/pdf/nikon_zemax_data.zip
OHARA b8a0bea2a59ec643998040255925c7e051ea5352ff239f1aca50268ac27bb7f7 https://oharacorp.com/wp-content/uploads/2024/02/OHARA_240131_CATALOG.zip
HOYA b02c203e5a5b7a8918cc786badf0a9db1fe2572372c1c163dc306b0a8a908854 http://www.hoya-opticalworld.com/common/agf/HOYA20210105.agf
SCHOTT 02c3212e6984a553994caf7533c6c08f284f6ebc9312dbf90e605226577577e8 https://mss-p-009-delivery.stylelabs.cloud/api/public/content/a79c07aa61da4c05a2c0bbab93d09a7f?v=3b65e351&download=true
SUMITA fad12bfb1754ee9e33f7a6ec65c784c1dd1b8e87fde1ac2e440d24e85630c758 https://www.sumita-opt.co.jp/en/wp/wp-content/themes/sumita-opt-en/download-files.php files%5B%5D=new_sumita.agf&category=data
Expand Down
20 changes: 10 additions & 10 deletions src/NotebooksUtils/NotebooksUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Format
import Makie
import WGLMakie
import GLMakie
import JSServe
import Bonito

mutable struct Defs
authors::String # authors
Expand Down Expand Up @@ -271,7 +271,7 @@ function SetDocsBackend(be::String)
Makie.__init__();
Makie.inline!(true)

return JSServe.Page(exportable=true, offline=true)
return Bonito.Page(exportable=true, offline=true)
else
GLMakie.activate!()
Makie.__init__();
Expand All @@ -285,19 +285,19 @@ end
"""
InitNotebook(; port=8449)
initialize the JSServe package.
initialize the Bonito package.
"""
function InitNotebook(; port=8449)
@eval begin
try
import JSServe
import Bonito
local port = 8449 # the port you want
JSServe.JSSERVE_CONFIGURATION.listen_port[] = port
JSServe.JSSERVE_CONFIGURATION.external_url[] = "http://localhost:$(port)"
JSServe.JSSERVE_CONFIGURATION.content_delivery_url[] = "http://localhost:$(port)"
return JSServe.Page() # needs to get displayed by Pluto
Bonito.SERVER_CONFIGURATION.listen_port[] = port
Bonito.SERVER_CONFIGURATION.external_url[] = "http://localhost:$(port)"
Bonito.SERVER_CONFIGURATION.content_delivery_url[] = "http://localhost:$(port)"
return Bonito.Page() # needs to get displayed by Pluto
catch e
@warn "Can't initialize the JSServe package\n$e"
@warn "Can't initialize the Bonito package\n$e"
end
end
end
Expand Down Expand Up @@ -524,4 +524,4 @@ end

end # module NotebooksUtils

export NotebooksUtils
export NotebooksUtils
8 changes: 5 additions & 3 deletions src/RepeatingStructures/LensletAssembly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function project(lenslet::LensletAssembly{T}, displaypoint::SVector{3,T}, vertex
return SMatrix{2,N,T}(projectedpoints)
end

function convertlazysets(verts::LazySets.VectorIterator)
function convertlazysets(verts::AbstractVector)
M = length(verts)
T = eltype(eltype(verts))
temp = MMatrix{3,M,T}(undef)
Expand All @@ -94,8 +94,10 @@ function beamenergy(assy::LensletAssembly{T}, displaypoint::AbstractVector{T}, p
lensverts3D = vcat(lensverts, temp)
beamlens = SphericalPolygon(lensverts3D, virtpoint, T(1))

projpoly = LazySets.VPolygon(projectedpoints)
lenspoly = LazySets.VPolygon(lensverts)
# build regular Matrix as a workaround until
# https://github.com/JuliaReach/LazySets.jl/pull/3632 is merged
projpoly = LazySets.VPolygon(Matrix(projectedpoints))
lenspoly = LazySets.VPolygon(Matrix(lensverts))
intsct = projpoly lenspoly # this could be slow, especially multithreaded, because it will allocate. Lazysets.vertices returns Vector{SVector}, rather than SMatrix or SVector{SVector}.

if isempty(intsct)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ alltestsets = [
"Paraxial",
"ParaxialAnalysis",
"Transform",
"JuliaLang",
# "JuliaLang",
# "BVH",
# "Examples", # slow
"General",
Expand Down

0 comments on commit 6e6c44e

Please sign in to comment.