tidy3d icon indicating copy to clipboard operation
tidy3d copied to clipboard

Invalid link for `from_url` example in docs

Open tomflexcompute opened this issue 1 year ago • 5 comments

In the docs page about the from_url class method, it lists an example page image

This page can not be open in the browser, nor does it work when using it in the code image

I'm a bit confused about where to find the correct link from refractiveindex.io in general. I can find links like https://refractiveindex.info/database/data-nk/main/Fe/Johnson.yml but it doesn't work for from_url either.

tomflexcompute avatar Dec 24 '23 14:12 tomflexcompute

I see that there is a test for from_url in test_dispersion_fitter.py using some mock data. Maybe it's worth it to have another test using data directly from refractiveindex.io?

tomflexcompute avatar Dec 26 '23 22:12 tomflexcompute

The link in the doc page is outdated: it should be https://refractiveindex.info/data_csv.php?datafile=database/data-nk/main/Ag/Johnson.yml

I'm a bit confused about where to find the correct link from refractiveindex.io in general. I can find links like https://refractiveindex.info/database/data-nk/main/Fe/Johnson.yml but it doesn't work for from_url either.

So the url is the link to a csv/txt file. For your Fe case, the url is https://refractiveindex.info/data_csv.php?datafile=database/data-nk/main/Fe/Johnson.yml

weiliangjin2021 avatar Dec 28 '23 05:12 weiliangjin2021

It seems like refractiveindex.io updates their website links from time to time.

tomflexcompute avatar Dec 28 '23 14:12 tomflexcompute

When I click this [CSV - comma separated] button it directly downloads the csv file without opening a new page. Clicking the [Full database record] button does open a webpage with data. Does from_url work with this page?

image image

tomflexcompute avatar Dec 28 '23 21:12 tomflexcompute

When I click this [CSV - comma separated] button it directly downloads the csv file without opening a new page. Clicking the [Full database record] button does open a webpage with data. Does from_url work with this page?

The webpage you mentioned seems to be in yml format. So from_url doesn't work with it directly. Let me think about it how to support it.

weiliangjin2021 avatar Dec 29 '23 05:12 weiliangjin2021

just going through open issues. was this one ever fixed?

tylerflex avatar May 31 '24 18:05 tylerflex

just going through open issues. was this one ever fixed?

not yet, let me push a fix to update the URL

weiliangjin2021 avatar May 31 '24 18:05 weiliangjin2021