How to stop a Python script if the input values do not make sense within the environment in which they will be analyzed?
To me you're kind of handling the exception in two ways:


you are acting like a library in the sense that you talk about an exception to be raised;
you are acting like an application in the sense that you print out error messages and then continue running.


I think you are mainly having the script / function be used as a library, as you return the matrix rather than printing it out. If you talking about handling the exception for a library function, which seems most reasonable, then you should raise an exception rather than returning a magic value (m = 0) that you can check. Make sure that the exception has a clear message that may be put into a stacktrace in case it isn't handled. So you catch and re-raise.

In your case it is probably best to throw a more specific exception in _get_coords though, e.g.:

raise ValueError(f'source_points = {source_points}' +
                 '\n could not be broadcasted as a numerical array' +
                 '\n with shape = (n, 3).')





  It works fine to me, because I can check if m == 0 in the other script to stop it


That's exactly what exceptions are for. Just let the other script catch it and stop. The situation could be different if you would want to keep on running with a different matrix.

Magic values are often unclear to the reader, and may be skipped on accident. Try to avoid them as much as possible. You don't want to run on with the magic value as invalid state, so raise and make sure you don't.



The same thing happens when you print Processing... to the output stream. Generally library functions don't print to the output stream. If you want to have a progress indication, then allow some kind of progress reporting function to be present as parameter or class field, and report progress that way. If you just want to indicate that it started progressing then you should however just let the user of the library report that a function is called.

Using a logger rather than output stream would be highly advisable.

You can find more information about listeners here. Logging is also mentioned over there, which is likely not coincidental.