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

In Open From Library dialog, open R script file and write to the Script Window, also added Niger script file #7038

Conversation

N-thony
Copy link
Collaborator

@N-thony N-thony commented Dec 6, 2021

Fixes #6984
This PR adds the Niger script file to the Climatic > Niger folder and also the facility to open an R script to the Script Window from Open From Library.
@africanmathsinitiative/developers @rdstern this is ready for review. Thanks.

instat/dlgImportDataset.vb Outdated Show resolved Hide resolved
instat/dlgImportDataset.vb Show resolved Hide resolved
instat/dlgImportDataset.vb Show resolved Hide resolved
instat/dlgImportDataset.vb Outdated Show resolved Hide resolved
instat/ucrScript.vb Outdated Show resolved Hide resolved
@N-thony
Copy link
Collaborator Author

N-thony commented Dec 7, 2021

@lloyddewit I have resolved your comments above. Please take a look. Thanks

Copy link
Contributor

@lloyddewit lloyddewit left a comment

Choose a reason for hiding this comment

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

Thanks, just a couple of small suggestions for readability

instat/dlgImportDataset.vb Outdated Show resolved Hide resolved
instat/dlgImportDataset.vb Outdated Show resolved Hide resolved
instat/dlgImportDataset.vb Show resolved Hide resolved
@N-thony
Copy link
Collaborator Author

N-thony commented Dec 8, 2021

@lloyddewit I resolved your comment above. Please take a look. Thanks.

Copy link
Collaborator

@rdstern rdstern left a comment

Choose a reason for hiding this comment

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

I first tried with the script window empty and it worked fine. It also didn't ask me - which it used to - and was unnecessary.
So - good so far.
Then I tried with a second file and with something already in the script window. It warned me - that's good too.
So I said no (I realise I should have tested yes as well, but didn't.) Anyway after no it returned me to the ordinary Import file dialogue with that R file. So I pressed Ok and it gave me an error.

Two points follow from this:
a) It would be good if the Import dialogue could also recognise an R-file and put it into the script window. Currently the only way is via right-click once in the script window.
b) A separate point is whether it should go to the import dialogue when I say No to overwriting the existing file in the script window. I'm not sure about this.

@N-thony
Copy link
Collaborator Author

N-thony commented Dec 10, 2021

I first tried with the script window empty and it worked fine. It also didn't ask me - which it used to - and was unnecessary. So - good so far. Then I tried with a second file and with something already in the script window. It warned me - that's good too. So I said no (I realise I should have tested yes as well, but didn't.) Anyway after no it returned me to the ordinary Import file dialogue with that R file. So I pressed Ok and it gave me an error.

Two points follow from this: a) It would be good if the Import dialogue could also recognise an R-file and put it into the script window. Currently the only way is via right-click once in the script window. b) A separate point is whether it should go to the import dialogue when I say No to overwriting the existing file in the script window. I'm not sure about this.

@rdstern I resolved your comments above, please take a look. Thanks,

Copy link
Collaborator

@rdstern rdstern left a comment

Choose a reason for hiding this comment

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

@N-thony this now works perfectly - though with a big "but"!
As far as I have tested the File > Open From Library seems to work ok. (As I write this I realis that I haven't tested fully when you load a sequence of R files and then a data file and then an R file again. So that will be good to check.
But, now the new code interacts with the File > Input from file dialogue, and in a pretty fundamental way.
a) I had a file in the script window. When I use File > Import File (instead of Input from library), it gives me the warning that I would expect from the Input from Library dialogue.
b) So I cleared the script window and tried File > Import again. Then it returned the previous script automatically!
Now I would also like the File > Import File dialogue to be able to import a file into the script window. I assumed this would be a separate issue, but perhaps it may be simpler to add this feature to the File > Import dialogue now???

@N-thony
Copy link
Collaborator Author

N-thony commented Dec 11, 2021

@rdstern the change I made temporarily resolved your comments above. With a possibility to import an r script From both File and Library.

Copy link
Collaborator

@rdstern rdstern left a comment

Choose a reason for hiding this comment

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

@N-thony great - this seems to work now.

@lloyddewit lloyddewit changed the title Opening an R script to the Script Window from Open From Library In Open From Library dialog, open R script file and write to the Script Window, also added Niger script file Jan 5, 2022
@lloyddewit lloyddewit merged commit fefa9bc into IDEMSInternational:master Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opening R scripts from R-Instat library into script window
3 participants