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

run miss_hit on octave jupyter notebook #264

Open
Remi-Gau opened this issue Dec 26, 2022 · 7 comments
Open

run miss_hit on octave jupyter notebook #264

Remi-Gau opened this issue Dec 26, 2022 · 7 comments
Labels
component: core Affects the core infrastructure difficulty: high This change will be tricky or large

Comments

@Remi-Gau
Copy link
Contributor

What kind of feature is this?

  • New feature in MISS_HIT

Your MATLAB/Octave environment

  • Octave >= 6

MISS_HIT component affected

  • Style checker
  • Code metrics
  • Documentation

Describe the solution you'd like

I have some demos that I keep primarily in Octave jupyter notebooks so they can be run in the browser on binder.

My current workflow involves converting the jupyter notebook to a .m file with this script:

https://github.com/cpp-lln-lab/bidspm/blob/main/demos/convert.py

Apply miss_hit to the .m file and then fix the notebook.

Being able to apply miss_hit directly to the notebook would be definitely a nice to have.

@florianschanda florianschanda added the component: core Affects the core infrastructure label Dec 26, 2022
@florianschanda florianschanda added the difficulty: high This change will be tricky or large label Dec 26, 2022
@florianschanda
Copy link
Owner

Could you email me 1-2 of these notebooks so I have something to work from? Ideally with a few mistakes in them that you'd like MISS_HIT to fix? My email is in the commit logs. I have never used jupyter, i barely know what it is, so to avoid making a non-representative testcase it would be best if you could provide something.

Even better if you will allow me to put it in the test-suite.

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Feb 5, 2023

I actually have a few that I use as demo to run in binder on some projects.

For example:
https://github.com/cpp-lln-lab/bidspm/blob/main/demos/MoAE/moae_01_bids_app.ipynb

Or see several here:
https://github.com/bids-standard/bids-matlab/tree/dev/demos/notebooks

Notebooks are actually json files with all cell contents stored in an array of cells that can either be markdown or code.

{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "13de9b92",
   "metadata": {},
   "source": [
    "# MoAE demo\n",
    " (C) Copyright 2022 Remi Gau\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e0e9b1e0",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "addpath('/home/remi/matlab/SPM/spm12');"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Octave",
   "language": "python",
   "name": "octave"
  },
  "language_info": {
   "file_extension": ".m",
   "help_links": [
    {
     "text": "GNU Octave",
     "url": "https://www.gnu.org/software/octave/support.html"
    },
    {
     "text": "Octave Kernel",
     "url": "https://github.com/Calysto/octave_kernel"
    },
    {
     "text": "MetaKernel Magics",
     "url": "https://metakernel.readthedocs.io/en/latest/source/README.html"
    }
   ],
   "mimetype": "text/x-octave",
   "name": "python",
   "version": "3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) \n[GCC 10.3.0]"
  },
  "vscode": {
   "interpreter": {
    "hash": "57bcab47fba392aaf2481e270a6c32db0c9d247c375febbd49c7b44fb61a4644"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}

@florianschanda
Copy link
Owner

I assume you use this kernel? https://github.com/Calysto/octave_kernel

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Feb 5, 2023

yes indeed!

@florianschanda
Copy link
Owner

I am thinking on how to produce feedback.
For example in https://github.com/Calysto/octave_kernel/blob/main/octave_kernel.ipynb

The first bit of code is:

t = linspace(0,6*pi,100);
plot(sin(t))
grid on
hold on
plot(cos(t), 'r')

There are some missing ; so how do I complain?

In the notebook shown on github it says In [1]: I could use that maybe, so say:

foo.ipynb:In [1]:2:13: missing semicolon

Would that be user-friendly enough?

I do something similar for matlab-in-simulink blocks so at least it would be consistent?

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Feb 5, 2023

yes that would look good to me. And if you can things consistent for you to make your life easier: go for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core Affects the core infrastructure difficulty: high This change will be tricky or large
Projects
None yet
Development

No branches or pull requests

2 participants