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

Update the examples #52

Merged
merged 93 commits into from
Dec 18, 2020
Merged

Update the examples #52

merged 93 commits into from
Dec 18, 2020

Conversation

prjemian
Copy link
Contributor

@prjemian prjemian commented Nov 24, 2020

Will fix #24 and fix #51 and fix #57

@prjemian prjemian marked this pull request as draft November 24, 2020 18:38
@prjemian prjemian added this to the 0.3.15 milestone Nov 24, 2020
@prjemian prjemian added this to To do in v0.3.15 release Nov 24, 2020
@prjemian
Copy link
Contributor Author

Since the CI has jumped to the front of the priority queue, I'm working on #54 first and will sync from main into this branch so it gets the new, much faster, CI toolchain.

@prjemian prjemian moved this from To do to In progress in v0.3.15 release Dec 3, 2020
@prjemian
Copy link
Contributor Author

prjemian commented Dec 3, 2020

Ready to proceed with the work of #52.

@prjemian prjemian self-assigned this Dec 4, 2020
Copy link
Member

@mrakitin mrakitin left a comment

Choose a reason for hiding this comment

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

I have a couple of comments after my review.

docs/source/examples/index.rst Outdated Show resolved Hide resolved
docs/source/examples/index.rst Outdated Show resolved Hide resolved
docs/source/examples/index.rst Outdated Show resolved Hide resolved
examples/README.md Show resolved Hide resolved
prjemian and others added 3 commits December 18, 2020 10:46
Co-authored-by: Maksim Rakitin <mrakitin@users.noreply.github.com>
Co-authored-by: Maksim Rakitin <mrakitin@users.noreply.github.com>
Co-authored-by: Maksim Rakitin <mrakitin@users.noreply.github.com>
@prjemian
Copy link
Contributor Author

@ambarb : Found the FIXME item in tst_e4cv_fourc.ipynb:

(bluesky_2021_1) prjemian@poof ~/.../Bluesky/hklpy $ git grep FIXME | grep examples/
examples/archive/e6c_sixc.ipynb:    "# FIXME:  must get same numbers, probably in different rows\n",
examples/archive/hkl-example.ipynb:    "# FIXME: So far, only works when previous constraints are removed.  Wrong mode?\n",
examples/archive/hkl-example.ipynb:    "# FIXME: pick mode\n",
examples/archive/tardis_example.ipynb:    "# FIXME: hack to get around what should have been done at init of tardis_calc instance\n",
examples/archive/tardis_example.ipynb:    "    # energy=tardis_calc.energy, # FIXME: unexpected keyword argument\n",
examples/tst_e4cv_fourc.ipynb:    "# FIXME: (113) `th` values do not match."

@prjemian
Copy link
Contributor Author

print consistency:

(bluesky_2021_1) prjemian@poof ~/.../Bluesky/hklpy $ git grep print | grep ipynb | grep -v /archive/
examples/geo_e4cv.ipynb:    "print(tbl)\n",
examples/geo_e4cv.ipynb:    "print(f\"sample\\t{fourc.calc.sample}\")"
examples/geo_e4cv.ipynb:    "print(\"axis names:\", fourc.calc.physical_axis_names)"
examples/geo_e4cv.ipynb:    "print(f\"(4 0 0) ? {sol.h:.2f} {sol.k:.2f} {sol.l:.2f}\")"
examples/geo_e4cv.ipynb:    "print(\n",
examples/geo_e4cv.ipynb:    "print(f\"(0 4 0) ? {sol.h:.2f} {sol.k:.2f} {sol.l:.2f}\")"
examples/geo_e4cv.ipynb:    "print(\n",
examples/geo_e4cv.ipynb:    "print(\"possible modes:\", fourc.calc.engine.modes)\n",
examples/geo_e4cv.ipynb:    "print(\"chosen mode:\", fourc.calc.engine.mode)\n",
examples/geo_e6c.ipynb:    "print(tbl)\n",
examples/geo_e6c.ipynb:    "print(f\"sample\\t{sixc.calc.sample}\")"
examples/geo_e6c.ipynb:    "print(\"axis names:\", sixc.calc.physical_axis_names)"
examples/geo_e6c.ipynb:    "print(f\"(4 0 0) ? {sol.h:.2f} {sol.k:.2f} {sol.l:.2f}\")"
examples/geo_e6c.ipynb:    "print(\n",
examples/geo_e6c.ipynb:    "print(f\"(0 4 0) ? {sol.h:.2f} {sol.k:.2f} {sol.l:.2f}\")"
examples/geo_e6c.ipynb:    "print(\n",
examples/geo_e6c.ipynb:    "print(\"possible modes:\", sixc.calc.engine.modes)\n",
examples/geo_e6c.ipynb:    "print(\"chosen mode:\", sixc.calc.engine.mode)\n",
examples/geo_k4cv.ipynb:    "print(tbl)\n",
examples/geo_k4cv.ipynb:    "print(f\"sample\\t{k4cv.calc.sample}\")"
examples/geo_k4cv.ipynb:    "print(\"axis names:\", k4cv.calc.physical_axis_names)"
examples/geo_k4cv.ipynb:    "print(\"(4 0 0) ?\", f\"{sol.h:.2f}\", f\"{sol.k:.2f}\", f\"{sol.l:.2f}\")\n"
examples/geo_k4cv.ipynb:    "print(\n",
examples/geo_k4cv.ipynb:    "print(\"(0 4 0) ?\", f\"{sol.h:.2f}\", f\"{sol.k:.2f}\", f\"{sol.l:.2f}\")"
examples/geo_k4cv.ipynb:    "print(\n",
examples/tst_e4cv_fourc.ipynb:    "print(tbl)"
examples/tst_e4cv_fourc.ipynb:    "print(spec_d.UB)\n",
examples/tst_e4cv_fourc.ipynb:    "print(fourc.UB.get())\n",
examples/tst_e4cv_fourc.ipynb:    "print(\"(002) :\", fourc.forward((0, 0, 2)))\n",
examples/tst_e4cv_fourc.ipynb:    "print(\"(113) :\", fourc.forward((1, 1, 3)))"
examples/tst_e4cv_fourc.ipynb:    "print(tbl)\n",
examples/tst_e4cv_fourc.ipynb:    "print(tbl)"
examples/tst_e4cv_fourc.ipynb:    "print(tbl)\n",
examples/tst_e4cv_fourc.ipynb:    "print(f\"sample\\t{fourc.calc.sample}\")"
examples/tst_e4cv_fourc.ipynb:    "print(tbl)"
examples/tst_e6c_test_calculations.ipynb:    "print('lattice', sample.lattice)\n",
examples/tst_e6c_test_calculations.ipynb:    "print('physical axes', calc.physical_axes)\n",
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo axes', calc.pseudo_axes)\n",
examples/tst_e6c_test_calculations.ipynb:    "print('omega parameter is', calc['omega'])"
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo should be (0,1,0)=', calc.pseudo_axes)\n"
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo should be (0,1,0)=', calc.pseudo_axes)"
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo should be (0,-1,0)=', calc.pseudo_axes)\n"
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo should be (-1,0,0)=', calc.pseudo_axes)\n"
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo should be (1,0,0)=', calc.pseudo_axes)\n",
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo should be (1,0,0)=', calc.pseudo_axes)\n",
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo should be (1,0,0)=', calc.pseudo_axes)"
examples/tst_e6c_test_calculations.ipynb:    "print('pseudo should be (0,1,1)=', calc.pseudo_axes)"
examples/tst_e6c_test_calculations.ipynb:    "    print(\"expecting either 120 or -120 (approximately):\", sol.omega + sol.phi)"
examples/var_e4cv_renamed_axes.ipynb:    "print(\"motor names:\", fourc.calc.physical_axis_names)"
examples/var_e4cv_renamed_axes.ipynb:    "print(\"motor names:\", fourc.calc.physical_axis_names)"
examples/var_e4cv_renamed_axes.ipynb:    "print(tbl)\n",
examples/var_e4cv_renamed_axes.ipynb:    "print(f\"sample\\t{fourc.calc.sample}\")"
examples/var_e4cv_renamed_axes.ipynb:    "print(\"(4 0 0) ?\", f\"{sol.h:.2f}\", f\"{sol.k:.2f}\", f\"{sol.l:.2f}\")"
examples/var_e4cv_renamed_axes.ipynb:    "print(\n",
examples/var_e4cv_renamed_axes.ipynb:    "print(\"(0 4 0) ?\", f\"{sol.h:.2f}\", f\"{sol.k:.2f}\", f\"{sol.l:.2f}\")"

@prjemian
Copy link
Contributor Author

Anything else? More suggestions for the examples to show (for the following 0.3.16 milestone)?

Copy link
Member

@mrakitin mrakitin left a comment

Choose a reason for hiding this comment

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

Looks good to me! @prjemian, thanks for making it more consistent and easier to read/understand.

@ambarb, @prjemian, sorry I did not put a link to the relevant notebook.

@prjemian
Copy link
Contributor Author

Thanks for the review, @mrakitin! @ambarb Are you satisfied, as well?

@prjemian
Copy link
Contributor Author

We can remove the requirements files. Only used for travis configuration and builds.

@prjemian
Copy link
Contributor Author

(bluesky_2021_1) prjemian@poof ~/.../Bluesky/hklpy $ git grep requirement
.github/workflows/publish-docs.yml:    - name: Install publishing requirements
.travis.yml:        pip install --upgrade -r requirements-doc.txt

@mrakitin
Copy link
Member

(bluesky_2021_1) prjemian@poof ~/.../Bluesky/hklpy $ git grep requirement
.github/workflows/publish-docs.yml:    - name: Install publishing requirements
.travis.yml:        pip install --upgrade -r requirements-doc.txt

It used to be very convenient to use it locally to build docs or run tests. Now it seems all requirements are coming from conda channels, and the requirements-*.txt files may not be that useful.

@prjemian
Copy link
Contributor Author

Note: deleted previous comment since it was for a different repository. No new problem here.

@mrakitin
Copy link
Member

@ambarb, if you don't have any concerns here?

@ambarb
Copy link

ambarb commented Dec 18, 2020

I am all good if this is for

hklpy/examples/*ipynb

I didn't look in the examples archive as that seems like some of that stuff is on track for obsolete. If you can confirm I didn't miss part of the PR for hklpy library, I am go good to go on this PR. Thanks @prjemian for all the work.

@prjemian
Copy link
Contributor Author

That's right. The archive directory is for deletion by release 1.0.0. Just keeping it handy, yet out of the way, in case we miss something there.

@prjemian
Copy link
Contributor Author

Proceeding with the merge. Big thanks! It's my holiday present.

@prjemian
Copy link
Contributor Author

I'll change the notebook viewer URLs (#69) after merging this PR.

@prjemian prjemian merged commit 6a94d2f into main Dec 18, 2020
v0.3.15 release automation moved this from In progress to Done Dec 18, 2020
@prjemian prjemian deleted the 24-examples branch December 18, 2020 21:28
@mrakitin
Copy link
Member

Thanks @prjemian!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
3 participants