In our company we learned to connect our notebook to git repository, however there is an issue.
Running a notebook inside another notebook. This is the way that we have discovered, however this solution cant go into production because it included an employee username in the path.
What is/are solution to solve it?
You need to use relative paths for %run command. For example:
./name for notebook in current directory
../name for notebook in parent directory
../../name for notebook in two levels higher
subdir/name for notebook in sub-directory with name subdir
You can also consider to use arbitrary files support in Repos, although it's mostly for Python & R modules.
Related
It used to be the case that one could easily edit colab notebooks from within GitHub, and also move them (so long as one remembered to change the path in the notebook itself).
Just now I noticed that this functionality in the GitHub browser seems to have been removed. Is this a bug? Is there workaround that does not involve the command line and git?
Is there any way that I can locally link from one Jupyter notebook to another on GitHub without the need to embed the absolute path, such as https://github.com/jeffheaton/test-linking/blob/main/notebook1.ipynb?
I create a notebook (notebook1.ipynb)
With this content:
# This is Notebook 1
* [Link to Notebook 2a](notebook2.ipynb)
* [Link to Notebook 2b](./notebook2.ipynb))
I tried two different methods, one using the . for current directory. Neither worked.
notebook2.ipynb is actually at this URL:
https://github.com/jeffheaton/test-linking/blob/main/notebook2.ipynb
However, GitHub transforms my link into:
https://notebooks.githubusercontent.com/view/notebook2.ipynb
Which results in a bad link.
If I put this same markdown into README.md it works fine. Just does not seem to like jupyter notebooks.
I would really like to NOT have to prefix everything with https://github.com/jeffheaton/test-linking/blob/main/, because the local links:
Work locally, outside of GitHub
On GitHub are branch agnostic
You can see my attempts to make this work at this short repo: https://github.com/jeffheaton/test-linking
In case anyone happens upon this question. GitHub resolved this issue, relative links now appear to work just fine.
I am a new user of python and github.
I want to use, with anaconda-jupyter on windows 10, a new repository (module) published on github ( https://github.com/jamesbowman/raytrace ).
I downloaded the zip folder and extracted it in my download folder (F:\Téléchargement\raytrace-master). , but I don’t know how to use this module with jupyter .
How can I import this module into jupyter .
I tried some method but without success
Why it is not possible to copy and paste directly a folder from my download folder (F:/téléchargement/) to a jupyter notebook folder (…/source/repos/ for example ) ?
Thanks!
Try using the http copy url from the Github site and use that with
!git clone <https://github.com...> in a jupyter notebook cell
then you can do !ls to check that the repository downloaded. The exclamation points mean that you can do command line commands from your notebook!
Alternatively, you could try unzipping and moving the repo to the same directory where you are running jupyter and search for it with an !ls
I'm working a lot with Virtual Machines and look for an efficient way to easily manipulate the files on the VM while still having them in sync with my local filesystem from where I commit them to the VCS.
I tried the remote Remote Systems Explorer for Eclipse. This gives me easy access to the files on the remote system, but has no synchronize option. So I can work directly on the remote files, but I need to sync it back to my local directory to commit them.
Basically I need some kind of rsync (Windows machine though) so that i only need to manipulate either my local files and sync the VM files or vice versa.
Can anybody help with that issue?
Looking at your reputation, I guess you can probably create some script to synchronize the local files on the command line outside Eclipse. If so, then you can have this script be invoked automatically from Eclipse as part of your normal (automated) project build. To do so, you only have to add a new builder to the project, which invokes that script.
This tutorial shows how to invoke an ant script during each build. You can restrict the invoked builder to changes of specific files and working sets, if you don't want to trigger that script on each file change.
I am working on a project that depends on external programs, and needs to know the paths to them. I develop and use the project on several machines, using mercurial for version control. The paths are machine-dependent, so I keep them in a machine-specific config file. I would like the config file for each host to be version-controlled, but I need to ensure that the config file from one host would never overwrite the config file for another host when pushing or pulling between hosts. Is there any way to accomplish this?
In principle, Wim is right: machine specific configurations shouldn't be part of the project's source control. As long as you walk alone, this isn't a real problem, but once you want to provide generic releases of your project, you have to get rid of them. In that case you might not be happy about the fact, that the change history contains files with machine specific data.
Nevertheless, it may make sense to have machine specific data in version controlled files (personally I do this for my dot-rc files and shell scripts). In that case I would suggest to separate generic and specific configurations into different files and include/utilize the specific one at build- or runtime, depending on the currently used machine.
If it is not possible to detect the current machine automatically, you could still create an unversioned symbolic link on each machine, pointing to the appropriate specific configuration file. For instance, on the machine foo the file layout could look like this:
generic.conf version-controlled
specific-foo.conf version-controlled
specific-bar.conf version-controlled
specific.conf → specific-foo.conf unversioned symbolic link
An alternative to symbolic links is to use a hook which automatically creates specific.conf, e.g. on each invocation of hg update. As hooks are set in a repository's hgrc file, it can be defined individually on each machine. Here's an example of a corresponding hooks section in the .hg/hgrc file of a repository clone on the machine foo:
[hooks]
update = cp specific-foo.conf specific.conf
Machine specific configuration settings should not be version controlled in the same repository as the project code.
However, it is still a good idea to put an inactive sample configuration file in your code repository. And this sample could show a bunch of typical locations for the external program paths you mentioned as lines that are commented out. That way you make it easier to get your project running on new machines.