question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should data processing functions have their own modules?

See original GitHub issue

In #685, @weiji14 asked the question of if data processing modules like makecpt and grd2cpt should be split into their own Python scripts, much like the plotting modules will be. My opinion is they should be split up. The other files aren’t nearly as big as base_plotting.py, but I think it’s best to standardize all functions in this way, and it makes it easier to find the function you’re looking for (I wasn’t sure if grd2cpt should be under mathops.py or grdops.py?).

I’m happy to do it. I’m assuming the process would be similar to the changes in base_plotting.py, and just involve copying the functions to their own scripts in pygmt.src, but how do we “tell” PyGMT where to look for it beyond the init file, as there isn’t a base_plotting-equivalent script to import into?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
maxrjonescommented, Mar 14, 2021
  • Move class config from pygmt/modules.py to pygmt/src/config.py
  • Rename pygmt/modules.py to pygmt/accessors.py

Sounds good.

I can help with this if needed.

1reaction
seismancommented, Feb 22, 2021

Ping @weiji14 to separate x2sys_init and x2sys_cross.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Data Scientists Guide to Python Modules and Packages
In this post, I will give a very simple tutorial on how to create and use your own packages and modules for data...
Read more >
Important Python Functions, Modules and Libraries for Data ...
The purpose of a library, a module and a function are the same. They are used for reusing the code. The concept of...
Read more >
Writing your own modules - YARA's documentation!
Here is where the module declares the functions and data structures that will be available for your YARA rules. In this case we...
Read more >
Functions & Modules - YouTube
The use of modules and functions is a significant step in learning to programme.Here we will introduce- Built in functions - Custom ......
Read more >
Modules, introduction - The Modern JavaScript Tutorial
Each module has its own top-level scope. In other words, top-level variables and functions from a module are not seen in other scripts....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found