• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

spedas / pyspedas / 23099976064

15 Mar 2026 12:47AM UTC coverage: 23.685% (-4.9%) from 28.587%
23099976064

push

github

jameswilburlewis
Tweaking the ACE test_data_dir test to see why it's failing in parallel tests

2 of 2 new or added lines in 1 file covered. (100.0%)

4936 existing lines in 87 files now uncovered.

11582 of 48901 relevant lines covered (23.68%)

0.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/pyspedas/tplot_tools/tplot_copy.py
1
# Copyright 2020 Regents of the University of Colorado. All Rights Reserved.
2
# Released under the MIT license.
3
# This software was developed at the University of Colorado's Laboratory for Atmospheric and Space Physics.
4
# Verify current version before use at: https://github.com/MAVENSDC/PyTplot
5

6
import logging
1✔
7
import pyspedas
1✔
8
from pyspedas.tplot_tools import store_data
1✔
9
from copy import deepcopy
1✔
10
from collections import OrderedDict
1✔
11

12

13
def tplot_copy(old_name, new_name):
1✔
14
    """
15
    This function will copy a tplot variables that is already stored in memory.
16

17
    Parameters
18
    ----------
19
        old_name : str
20
            Old name of the Tplot Variable
21
        new_name : str
22
            Name of the copied Tplot Variable
23

24
    Returns
25
    -------
26
        None
27

28
    Examples
29
    --------
30
        >>> # Copy Variable 1 into a new Variable 2
31
        >>> import pyspedas
32
        >>> pyspedas.tplot_copy("Variable1", "Variable2")
33

34
    """
35

36
    # if old name input is a number, convert to corresponding name
UNCOV
37
    if isinstance(old_name, int):
×
38
        if isinstance(pyspedas.tplot_tools.data_quants[old_name], dict):
×
39
            old_name = pyspedas.tplot_tools.data_quants[old_name]['name']
×
40
        else:
41
            old_name = pyspedas.tplot_tools.data_quants[old_name].name
×
42

43
    # check if old name is in current dictionary
UNCOV
44
    if old_name not in pyspedas.tplot_tools.data_quants.keys():
×
45
        logging.info("The name %s is currently not in pyspedas",old_name)
×
46
        return
×
47

48
    # Add a new data quantity with the copied data
UNCOV
49
    if isinstance(pyspedas.tplot_tools.data_quants[old_name], dict):
×
50
        # old variable is a non-record varying variable
51
        store_data(new_name, data={'y': pyspedas.tplot_tools.data_quants[old_name]['data']})
×
52
    else:
UNCOV
53
        pyspedas.tplot_tools.data_quants[new_name] = deepcopy(pyspedas.tplot_tools.data_quants[old_name])
×
UNCOV
54
        pyspedas.tplot_tools.data_quants[new_name].name = new_name
×
55

UNCOV
56
    return
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc