In this divisive political climate, it's not exactly a simple question: What's the happiest city in the United States?

That is what the financial advice website WalletHub set out to answer this week with its ranking of the happiest cities in the U.S. The results: You might want to consider moving to a tech city--and one that has plenty of sunshine.

Eight of the top 10 cities are in California, including Silicon Valley powerhouses San Jose and San Francisco, which came in at No. 2 and No. 4, respectively.

WalletHub ranked 150 of the largest cities in the country based on how well they fared in providing for their citizens in three different categories: emotional and physical well-being, income and employment, and community and environment. WalletHub found that San Francisco and San Jose--both of which routinely top lists of the cities with the highest-paid workers--dominated the income and employment categories, coming in at No. 2 and No. 3, respectively. Scores in the income and employment category were calculated based on a number of factors--including the share of households earning incomes above $75,000, job satisfaction, job security, and the unemployment rate.

The rankings come at a time when rising housing costs have Bay Area residents--tech workers included--grappling with whether they should continue to call the area home. A boom in luxury housing for the wealthy has made affordable housing hard to come by. A 2016 poll found that one-third of Bay Area residents were considering leaving the area, citing housing as one of the factors. The median home values in San Jose and San Francisco are $852,000 and $1.1 million, respectively, according to Zillow. WalletHub did not include cost of living as one of its criteria when calculating its happiest-cities rankings.

Nonetheless, the rankings suggest the luster of the Silicon Valley brand isn't diminishing anytime soon. The city that secured the title of the happiest in the U.S. was Fremont, California. Located on the outskirts of the Bay Area, Fremont began rebranding itself in 2013, as the city's economic development council wanted to prove that it could compete with nearby San Jose and Mountain View. The tag line leaders decided upon: "Think Silicon Valley."